リクエストを行うためにCoffeeScriptを使用していますgetJSON
:
$.getJSON(
"http://maps.googleapis.com/maps/api/distancematrix/json?callback=?"
origins: origin
destinations: destinations
sensor: false
success: (data) ->
console.log data
error: (data) ->
console.log data
'json'
)
URL は次のとおりです。
http://maps.googleapis.com/maps/api/distancematrix/json?callback=?&origins=-25.8350643,28.1636066&destinations=-25.551836,%2028.423075|-25.218503,%2027.923075|&sensor=false
それをブラウザに入力すると、JSON が返されますが、ajax リクエストは次のように伝えます。
Uncaught SyntaxError: Unexpected token:
何か案は?