Reputation: 21
I am trying to use the Markit on demand Api to do a simple stock search, but when I try to access the data through the API I get "Uncaught SyntaxError: Unexpected token : " on the JSON. The JSON that is returned within the error is correct:
{"Data":{"Status":"SUCCESS","Name":"Apple Inc","Symbol":"AAPL","LastPrice":482.73,"Change":-0.0199999999999818,"ChangePercent":-0.00414293112376285,"Timestamp":"Fri Sep 27 15:59:59 UTC-04:00 2013","MarketCap":438558756810,"Volume":642152,"ChangeYTD":532.1729,"ChangePercentYTD":-9.29075869891158,"High":484.635,"Low":480.72,"Open":483.64}}
Any ideas how to fix this error?
See my JSfiddle http://jsfiddle.net/tgilbert/fXgLt/ for the code.
Any help would be greatly appreciated.
Upvotes: 0
Views: 147
Reputation: 13570
You have set dataType to 'jsonp', so jQuery is trying to perform a jsonp request and expects the response to be valid javascript, not just json.
Upvotes: 1