PHP Classes

File: static/js/ajax.js

Recommend this page to a friend!
  Classes of Pierre-Henry Soria   PHP Website Informer Tools   static/js/ajax.js   Download  
File: static/js/ajax.js
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: PHP Website Informer Tools
Tool to show relevant information about Web sites
Author: By
Last change:
Date: 9 months ago
Size: 1,267 bytes
 

Contents

Class file image Download
/** * Ajax JS File * * @package Static \ JS \ Get Meta Tools * @author SORIA Pierre-Henry * @email pierrehs@hotmail.com * @link http:// * @copyright Copyright pH7 Script All Rights Reserved. * @license CC-BY - http://creativecommons.org/licenses/by/3.0/ * @version $Id: dataUri.php 2012-02-2 pierrehs $ */ $(document).ready(function() { if (window.history && history.pushState) { historyedited = false; $(window).bind('popstate', function(e) { if (historyedited) { loadPage(location.pathname + location.search); } }); doPager(); } }); function doPager() { $('#content a, #header a, #footer_link a').click(function(e) { e.preventDefault(); $('#content').html("<div id='loading'>Loading...</div>"); loadPage($(this).attr('href')); history.pushState(null, null, $(this).attr('href')); historyedited = true; }); } function loadPage(link) { $.ajax({ url: link, processData: true, dataType:'html', success: function(data){ var content = $(data).find("#content"); var title = $(data).filter('title').text(); document.title = title; $('#content').fadeOut('200',function(){ $(this).html(content.html()).fadeIn('200'); }); } }); doPager(); }