get JSON file
get JSON file
Can someone help me end explain me why the following script doesn't work:
- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
- "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
- <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
- <head>
- <title>sans titre</title>
- <meta http-equiv="content-type" content="text/html;charset=utf-8" />
- <meta name="generator" content="Geany 1.22" />
- <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
- </head>
- <body>
- <p id="test">Null</p>
- <script>
- //URL="https://data.mtgox.com/api/2/BTCUSD/money/ticker";
- URL="https://btc-e.com/api/2/btc_usd/ticker";
- $.ajax({
- type: "POST",
- url: URL,
- success: function(json) {
- alert("ajax: success");
- }
- }).fail(function() { alert("ajax: error"); });
- $.getJSON(URL, function( json ) {
- alert("getJSON: success");
- }).fail(function() { alert("getJSON: error"); });;
- $.get(URL, function(data) {
- alert("get: success");
- }).fail(function() { alert("get: error"); });
- $.post(URL, function(data) {
- alert('post: success');
- }).fail(function() { alert("post: error"); });
- </script>
- </body>
- </html>