To everyone
I am trying to get the exchange rate from Google using jQuery $ .getJSON (). Using the query: " http://www.google.com/ig/calculator?hl=en&q=1USD=?CAD"
returns a simple JSON file: {lhs: "1 U.S. dollar",rhs: "1.03800015 Canadian dollars",error: "",icc: true}
I use the following jquery function to get the Canadian dollar amount .:
$(document).ready(function(){
$.getJSON("http://www.google.com/ig/calculator?hl=en&q=1USD=?CAD?&label=rhs&format=json&jsoncallback=?",
function(data){
alert(data);
});
});
</script>
The Fire error displays the correct JSON file, but indicates that an invalid label is being used.
Any help is appreciated.
Bean
source
share