I set dataType to "text" because I don't want Jquery to parse my JSON automatically. My code is as follows:
var membId = '5'; $('#submitNewDescription').live('click',function(){ //An ajax request is made to update the DB $.ajax({ url: '../../cgi-bin/qualification.py', type: 'POST', data: ({newDescription:$('#newDescription').val(),id:membId}), dataType: 'text', cache: 'false', success: function(data){ json = JSON.parse(data); console.log(data); console.log(json); } }); });
And it returns this line: {"error": ["ORA-01031 Invalid privileges"]} in both console.log commands. This means that parsing does not work because it does not return a JavaScript object. JSONLint tells me that it is valid JSON.
Does anyone have an idea of ββwhat is going on?
thanks
EDIT
I can install 'json', this is not a problem. The problem is that JSON.parse and $ .parseJSON should work. Since this is not the case, I changed 'dataType' to 'json', but the same line is returned. I have no idea what is going on.
Luiz Fernando
source share