daily pastebin goal
45%
SHARE
TWEET

Untitled

a guest Feb 13th, 2018 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <!doctype html>
  2. <html lang="en">
  3.  
  4. <head>
  5.   <meta charset="utf-8">
  6.   <title>Uutiset</title>
  7.   <!-- <link rel="stylesheet" href="//code.jquery.com/ui/1.12.1/themes/base/jquery-ui.css"> -->
  8.   <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  9.   <!-- <script src="https://code.jquery.com/ui/1.12.1/jquery-ui.js"></script> -->
  10. </head>
  11.  
  12. <body>
  13.  
  14.   <h1>Ajax</h1>
  15.   <div id="alue1"></div>
  16.   <button id="btn_esim1">Lataa Uutiset</button><br>
  17.   <p1 id="uutiset"></p1>
  18.  
  19.   <script>
  20.     $("#btn_esim1").click(function() {
  21.       $.getJSON("uutiset.json", function(data) {
  22.         $.each(data, function(uutiset[0].julkaisuaika, kirjoittaja, artikkeli, sisalto) {
  23.           console.log("lol");
  24.  
  25.           //$("#alue1").text("Väri:" + data.key + "Arvo:" + data.val);
  26.           $("#uutiset").append("" + julkaisuaika + " " + artikkeli + "<br>");
  27.  
  28.         });
  29.       });
  30.     });
  31.   </script>
  32.  
  33. </body>
  34.  
  35. </html>
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top