jquery ajax call (2) -
can tell me wrong ?
<!doctype html> <html> <head> <script src="http://code.jquery.com/jquery-1.9.1.js"></script> <script> $(document).ready(function() { var url = 'http://www.google.com/ig/calculator?hl=en&q=100inr=?usd'; var title = "jquery"; $.getjson("http://www.google.com/ig/calculator?hl=en&q=100inr=?usd" + "&format=json&callback=?", function(data) { alert(data); }); });
<div id="div1">test page</div>
i making call , getting error. know why ? how make ajav calls url http://www.google.com/ig/calculator?hl=en&q=100inr=?usd
you can't make ajax calls cross-domain. need use jsonp make work cross-domain.
jquery's $.ajax method supports jsonp requests. if google api doesn't support jsonp style responses, out of luck. using proxy, suggest @felixkling, other option.
Comments
Post a Comment