Jquery Ajax not working

k0ka

New Member
For several days we're banging our head to find out the solution but we're not able to figure out why this code is not working.\[code\]var bing_url='http://api.search.live.net/json.aspx?JsonType=callback&JsonCallback=?&Appid=[OurApp Id]&query='+keyword+'&sources=web';$.ajax({ type: "GET", url: bing_url, dataType:"jsonp", success: function(response) { $("#result").html(''); if(response.SearchResponse.Web.Results.length) { $.each(response.SearchResponse.Web.Results, function(i,data) { var title=data.Title; var dis=data.Description; var url=data.Url; var finall="<div class='webresult'><div class='title'><a href='"+url+"'>"+title+"</a></div><div class='desc'>"+dis+"</div><div class='url'>"+url+"</div></div>"; $("#result").append(final); // Result }); parentwin.document.getElementsByTagName("body").item(0).innerHTML += final; } else { $("#result").html("<div id='no'>No Results</div>"); } } //success});\[/code\]This script will be called from any other web page from IE. It will search results from bing using bing api and then the results will be appended to the original page.Problem:This script is working when we directly open it. But it does not work when it is called from another page.
 
Back
Top