daily pastebin goal
44%
SHARE
TWEET

Untitled

a guest Feb 16th, 2019 78 in 331 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $(document).ready(function(){
  2.   $.ajax({
  3.     url: 'datatweet.json', // path to file
  4.     dataType: 'json', // type of file (text, json, xml, etc)
  5.     success: function(data) { // callback for successful completion
  6.       jmlTweet = isi.length;
  7.       buatTweet = "";
  8.       for(a=0; a<jmlTweet; a++){
  9.         buatTweet += "<div class='media'>"
  10.               +"<a class='media-left' href='#fake'><img alt='' class='media-object img-rounded' width='64px 64px' src='"+data[a].user[0].url_image+"'></a>"
  11.               +"<div class='media-body'>"
  12.               +"<h4 class='media-heading'>"+data[a].user[0].name+"</h4>"
  13.               +"<p>"+data[a].text+"</p>"
  14.               +"<ul class='nav nav-pills nav-pills-custom'>"
  15.                 +"<li><a href='#'><span class='glyphicon glyphicon-share-alt'></span></a></li>"
  16.                 +"<li><a href='#'><span class='glyphicon glyphicon-retweet'></span> "+data[a].retweet_count+"</a></li>"
  17.                 +"<li><a href='#'><span class='glyphicon glyphicon-star'></span> "+data[a].favourite_count+"</a></li>"
  18.                 +"<li><a href='#'><span class='glyphicon glyphicon-option-horizontal'></span></a></li>"
  19.               +"</ul>"
  20.             +"</div> </div>";
  21.       }
  22.       document.getElementById("tweet").innerHTML += buatTweet;
  23.     },
  24.     error: function() { // callback if there's an error
  25.       alert("error");
  26.     }
  27.   });    
  28.    
  29. });
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