i have a problem when parsing json from php to javascript
this is my example code :
//function
MethodAjax = function (wsFile, param) {
return $.a
jQuery's $.ajax() function will yield a JavaScript object if the response is JSON so I believe the error you're seeing is a result of trying to parse a JavaScript object and not a string as you're expecting. In the callback you're providing to the done
function, inspect data
and you'll find that it's an object and there is no need to JSON.parse
the result.