javascript - Traditional JSONP: Uncaught SyntaxError: Unexpected token : -


i have code:

<!doctype html> <html> <head>     <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"></script>     <title>test</title>     <script type="text/javascript" src="http://www.roblox.com/games/getgameinstancesjson?placeid=1818&startindex=0&jsonp=processresults"></script>     <script>         function parseresults(results) {             alert('success');         }     </script> </head> <body> </body> </html> 

when run this, comes error: uncaught syntaxerror: unexpected token :

i've looked up, solutions jquery. i'm not using jquery; i'm using "tranditional" jsonp.

how fix issue?

thank in advance.

try open http://www.roblox.com/games/getgameinstancesjson?placeid=1818&startindex=0&jsonp=processresults link in browser. can see returns json, not jsonp.

for work result should this:

processresults({json comes here}) 

instead of:

{json comes here} 

so guess might need consult documentation of server side script ensure returns encoded jsonp result response wrapped in callback function provided.

so if server doesn't support jsonp or cors, might need write server side script on own website act bridge between domain , remote host , send ajax request own domain.


Comments

Popular posts from this blog

asp.net mvc - SSO between MVCForum and Umbraco7 -

Python Tkinter keyboard using bind -

ubuntu - Selenium Node Not Connecting to Hub, Not Opening Port -