$(function(){ $(window).load(function(){ /* ***** Facebook ***** */ $.ajax({ beforeSend: function(){ }, url:'requests/facebook.php', dataType:'json', error:function(XMLHttpRequest, textStatus, errorThrown){ loadingStatus('facebook',1); }, success:function(data, textStatus, XMLHttpRequest) { var $html = '
'; $html += ''; $html += '

'+data.name+'

'; $html += '

'+data.location+'

'; $html += '

'+data.work+'

'; $html += '
'; $html += ''; $html += ''; $('#facebookCard').find('.content').html($html); loadingStatus('facebook',0); loadingStatus('facebook',1); } }); /* ***** Twitter ***** */ $.ajax({ beforeSend: function(){ }, url:'requests/twitter.php', dataType:'json', error:function(XMLHttpRequest, textStatus, errorThrown){ loadingStatus('twitter',1); }, success:function(data, textStatus, XMLHttpRequest) { if(data.name != ''){ //Apenas 150 requisições por hora. var $html = ''; $html += ''; $('#twitterCard .content').html($html); } loadingStatus('twitter',0); loadingStatus('twitter',1); } }); /* ***** Blog ***** */ $.ajax({ beforeSend: function(){ }, url:'requests/blog.php', dataType:'json', error:function(XMLHttpRequest, textStatus, errorThrown){ loadingStatus('blog',1); }, success:function(data, textStatus, XMLHttpRequest) { var $html = ''; $html += ''; $('#blogCard .content').html($html); loadingStatus('blog',0); loadingStatus('blog',1); } }); //END }); });