Advertisement
aznGiLL

basic getJSON

Sep 25th, 2013
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!DOCTYPE html>
  2.  
  3. <html lang="en" xmlns="http://www.w3.org/1999/xhtml">
  4. <head>
  5.     <meta charset="utf-8" />
  6.     <title>Øivind surr</title>
  7.     <script src="http://code.jquery.com/jquery-latest.min.js"></script>
  8.     <script>
  9.         $(function () {
  10.  
  11.             var feedURL = "VGfeed.json";
  12.  
  13.             $.getJSON(feedURL, function (bøtte) {
  14.  
  15.                 //var antArtister = $(this).find("artistName").size();
  16.                 //for (var i = 0; i < antArtister; i++) {
  17.                 //    $("#secMain").append("<h1>" + bøtte.artist[i].artistName + "</h1>");
  18.                 //}
  19.                
  20.  
  21.                 $.each(bøtte.artist, function (i, n) {
  22.                     $("#secMain").append("<h1>" + n.artistName + "</h1>");
  23.                 });
  24.  
  25.                 //var htmlTxt = "";
  26.                 //$(bøtte).find(bøtte).each(function () {
  27.                 //    htmlTxt += "<h1>";
  28.                 //    htmlTxt += artistName;
  29.                 //    htmlTxt += "</h1>";
  30.                 //});
  31.             });
  32.  
  33.         });
  34.     </script>
  35. </head>
  36. <body>
  37.     <section id="secMain">
  38.  
  39.     </section>
  40. </body>
  41. </html>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement