Advertisement
joris

My Code

Aug 30th, 2012
94
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var serviceURL = "http://bertho.web.id/curl/services21/";
  2.  
  3. var SistemPakar;
  4.  
  5. $('#sispakListPage').bind('pageinit', function(event) {
  6.     CallAjax();
  7. });
  8.  
  9.  
  10. function CallAjax(){
  11.     showLoad();
  12.     $.ajax({
  13.                 type : 'GET',
  14.                 url : serviceURL + 'DataReadNP.php',
  15.                 async: true,
  16.                 beforeSend: function(x) {
  17.                     if(x && x.overrideMimeType) {
  18.                          x.overrideMimeType("application/j-son;charset=UTF-8");
  19.                     }
  20.                 },
  21.                 dataType : 'json',
  22.                 success : function(data){
  23.                         StatusSuccess();
  24.                         SistemPakar = data.items;
  25.                         $.each(SistemPakar, function(index, antara) {
  26.                         $('#sispakList').append(
  27.                                '<li><a href="detailNowPlaying.html?id=' + antara.id + '">' +
  28.                                 '<img src="' + antara.img + '"/>' +
  29.                                 '<h4>'+ antara.judul +'</h4>' +
  30.                                 '<p>' + antara.web + '</p>' +
  31.                                 '<p>' + antara.desk + '</p>');
  32.                         });
  33.                         $('#sispakList').listview('refresh');
  34.                 },
  35.                 error : function(){
  36.                     StatusError();
  37.             }
  38.         });
  39. }
  40.  
  41. function showLoad(){
  42.     $('#loading').show().html('Status : Request Data From Server');
  43. }
  44. function StatusError(){
  45.     $('#imgerr').slideDown("slow");
  46.     $('#loading').show().html('Status : Your Connection Is Trouble');
  47. }
  48. function StatusSuccess(){
  49.     $('#loading').show().html('Status : Data Has Been Show');
  50. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement