Fighting Bing json request (bing search, not map), I get an error message that says "Invalid shortcut"
My request:
var bingurl="http://api.search.live.net/json.aspx?Appid=##APIKEY##&query=Honda&sources=web"; $.ajax({ type: "GET", url: bingurl, data: "{}", contentType: "application/json; charset=utf-8", dataType: "jsonp", success: function(data) { $callBack(data); }, error: function(msg) { alert("error" + msg); } });
Firebug reports an "invalid shortcut" and then issues a json response.
I don’t know what is wrong? help evaluate.
The URL of the Bing URL you submitted is not JSONP, it is just JSON.
JSONP JavaScript, JSON- {"something": ... , , (, ).
{"something": ...
,, , JSONP Bing, , , ...&JsonType=callback&JsonCallback= ( ).
...&JsonType=callback&JsonCallback=
( , data: "{}" , , - .)
data: "{}"
API Bing REST jsonp, , " " - "jsonp". jQuery jsonp $.ajax() "jsonp", .
$.ajax({ url: 'http://some.domain.com', dataType: 'jsonp', jsonp: 'jsonp' });`
Source: https://habr.com/ru/post/1745338/More articles:machine learning and line code generator - code-generationChoosing bookmark library for web browser - javascriptboost version upgrade - c ++How to use default arguments in php - phpThe safest way to idle a delphi application to wait for a timer? - memory-managementHow to find out if your Unit Test Fixture is right? - language-agnosticHow to replace a UITableViewController with a UIViewController that contains a UITableView? - cocoa-touchHow do you know if your Unit Test is “the right size”? - language-agnosticHow do I take pairs from a list in python? - pythonКак изменить исходный HTML-страницы ASP.NET на PreRender? - asp.netAll Articles