Quantcast
Viewing all articles
Browse latest Browse all 42

Answer by Chris for Unexpected Token '

Typically that means that you're request is failing and you're probably getting an html page instead of a JSON response. Parse is failing because it's receiving html and not a JSON object. Verify that the target url for the ajax is only returning valid JSON, any templating system wrapping the response, or a 404 will give you that response.

You can also use firebug or the chrome developer tool, look at your XHR requests and see what's in the body, if its not something like {my_data:''} then you've probably got an issue.

As another note you do not need the "?>" at the end of your file, they cause more issues than there worth if you end up with an extra line and even Zend recommends you don't use them.


Viewing all articles
Browse latest Browse all 42

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>