Existing:
var requestStr = "http://api.bing.net/json.aspx?"+query+ "JsonType=callback", "JsonCallback=?";
$.ajax({
type: "GET",
url: requestStr,
dataType: "jsonp",
cache: true,
timeout: 5,
success: function(msg) { i show the results; },error:function(msg){alert(msg.d)}
New code:
var arr=query+ other attributes;
var requestStr ="https://api.datamarket.azure.com/Data.ashx/Bing/Search/v1/Web"+arr;
$.ajax({
type: "GET",
url: requestStr,
dataType: "json",
context:this,
cache: true,
timeout: 5,
beforeSend: function(xhr){
xhr.setRequestHeader('Authorization', 'Basic username:azurekey');
},success: function(msg) { i show the results; },error:function(msg){alert(msg.d)}
I always end up in getting the error message : kindly suggest regarding my implementation.