get JSON file

get JSON file

Can someone help me end explain me why the following script doesn't work:

  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  2.     "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  3. <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

  4. <head>
  5.     <title>sans titre</title>
  6.     <meta http-equiv="content-type" content="text/html;charset=utf-8" />
  7.     <meta name="generator" content="Geany 1.22" />
  8.     <script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
  9. </head>

  10. <body>
  11. <p id="test">Null</p>
  12. <script>     
  13. //URL="https://data.mtgox.com/api/2/BTCUSD/money/ticker";
  14. URL="https://btc-e.com/api/2/btc_usd/ticker";

  15. $.ajax({
  16.     type: "POST",
  17.     url: URL,
  18.     success: function(json) {
  19.         alert("ajax: success");
  20.     }
  21. }).fail(function() { alert("ajax: error"); });

  22. $.getJSON(URL, function( json ) {
  23.     alert("getJSON: success");
  24. }).fail(function() { alert("getJSON: error"); });;

  25. $.get(URL, function(data) {
  26.     alert("get: success");
  27. }).fail(function() { alert("get: error"); });

  28. $.post(URL, function(data) {
  29.     alert('post: success');
  30. }).fail(function() { alert("post: error"); });

  31. </script>
  32. </body>

  33. </html>