Saturday, 15 June 2013

jquery - Cant seem to get my jsonp to work. What am i doing wrong here? -


I started building my website 2 weeks ago and has learned a bit of HTML, CSS and javascrip so far, But I can not do the following code for my site to be able to work:

  & lt; Head & gt; & Lt; Script src = "http://ajax.googleapis.com/ajax/libs/jquery/1.10.1/jquery.min.js" & gt; & Lt; / Script & gt; & Lt; Script & gt; $ (Document) .ready (function () {$ .getJSON ("http://blockchain.info/ticker?callback=?", Function (result) {document.getElementById ("testpan"). InnerHTML = result.EUR .last;});}); & Lt; / Script & gt; & Lt; / Head & gt; & Lt; Body & gt; & Lt; Ul & gt; & Lt; Li & gt; Exams: & lt; Span id = "testspan" & gt; Test & lt; / Span & gt; & Lt; / Ul & gt; & Lt; / Div & gt;   

What is basically in my list item to get "data" but only EUR.last specific value.

Many thx in advance!

The site does not support JSONP, which you call callback =? Trying to use with . The idea is that you will get the Javascript function call to wrap the object, which makes the cross-domain JavaScript request possible.

If we try to see it, you will see that the page does not have any function call so JSONP is not supported and you will need to find another way to do this, with.

No comments:

Post a Comment