-
27 Jun 2011 10:09 AM #1
"Uncaught SyntaxError: Unexpected token :" when using JSONP and scripttag
"Uncaught SyntaxError: Unexpected token :" when using JSONP and scripttag
Does anyone have any idea why this wouldn't work? I get the error when trying to load the json from my server.
"Uncaught SyntaxError: Unexpected token :" when using JSONP and scripttag
Code:Ext.regModel('MenuItem', { fields: [ {name: 'id', type: 'int'}, {name: 'title', type: 'string'} //{name: 'body', type: 'string'} ] }); MyDS.MenuStore = new Ext.data.Store({ model: 'MenuItem', proxy: { //type: 'ajax', type: 'scripttag', url: 'http://1ldev251.iqsolutions.com/myds2-rpc/testing.json', // DOES NOT WORK, EXACTLY THE SAME CONTENT AS THE BELOW URL: //url: 'http://query.yahooapis.com/v1/public/yql?format=json&q=select%20*%20from%20flickr.photos.search%20where%20text%3D%22hello%22%20limit%2010', // WORKS! reader: new Ext.data.JsonReader({ root: 'query.results.photo' }) } });
-
28 Jun 2011 6:19 AM #2
So the answer to this question is found here on another thread I was on, hopefully this helps someone else as well. Thanks bclinton for all your help!
http://www.sencha.com/forum/showthre...-and-scripttag
-
19 May 2012 1:33 AM #3
thank you was missing this
PHP Code:
$callback = $_REQUEST['callback'];if($callback){ header('Content-Type: text/javascript, charset=UTF-8'); echo $callback . '(' . json_encode($response) . ');';}else{ header('Content-Type: application/x-json, charset=UTF-8'); echo json_encode($response);}


Reply With Quote