SHARE
TWEET

Embed Artikel Wikipedia

pustakakoran Aug 2nd, 2018 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. HTML:
  2. <div id="article"></div>
  3.  
  4. JS:
  5. $(document).ready(function(){
  6.  
  7.     $.ajax({
  8.         type: "GET",
  9.         url: "http://id.wikipedia.org/w/api.php?action=parse&format=json&prop=text&page=Pembrita_Betawi&callback=?",
  10.         contentType: "application/json; charset=utf-8",
  11.         async: false,
  12.         dataType: "json",
  13.         success: function (data, textStatus, jqXHR) {
  14.  
  15.             var markup = data.parse.text["*"];
  16.             var blurb = $('<div></div>').html(markup);
  17.             $('#article').html($(blurb).find('p'));
  18.  
  19.         },
  20.         error: function (errorMessage) {
  21.         }
  22.     });
  23. });
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