/* ** history for ajax/javascript history ** 0.3 history events now setup in queue to ensure all entries reside in the history stack ** 0.2 no more FORM GET submission, straight location.href instead + hold time for iframe load ** 0.1 hidden frame + not bookmarkable + stores data for state change + allows reinstating data on forw/back hit ** authored by Jim Palmer - released under MIT license ** collage of ideas from Taku Sano, Mikage Sawatari, david bloom and Klaus Hartl */ (function($) { $.history = function ( store ) { // (initialize) create the hidden iframe if not on the root window.document.body if ( $(".__historyFrame").length == 0 ) { // set the history cursor to (-1) - this will be populated with current unix timestamp or 0 for the first screen $.history.cursor = $.history.intervalId = 0; // initialize the stack of history stored entries $.history.stack = {}; // initialize the stack of loading hold flags $.history._loading = {}; // initialize the queue for loading history fragments in sequence $.history._queue = []; // append to the root window.document.body without the src - uses class for toggleClass debugging - display:none doesn't work $("body").append('