Team:TU Delft/pieter/loadtest
From 2010.igem.org
(Difference between revisions)
Line 8: | Line 8: | ||
if(hash) { | if(hash) { | ||
// restore ajax loaded state | // restore ajax loaded state | ||
- | $("#load").load(hash + ".html"); | + | //$("#load").load(hash + ".html"); |
} else { | } else { | ||
// start page | // start page | ||
- | $("#load").empty(); | + | //$("#load").empty(); |
} | } | ||
} | } | ||
+ | |||
+ | $(function() { | ||
+ | |||
+ | // Initialize history plugin. | ||
+ | // The callback is called at once by present location.hash. | ||
+ | $.history.init(pageload); | ||
+ | |||
+ | // set onlick event for buttons | ||
+ | //$("a[@rel='history']").click(function(){ | ||
+ | // | ||
+ | // var hash = this.href; | ||
+ | // hash = hash.replace(/^.*#/, ''); | ||
+ | // moves to a new page. | ||
+ | // pageload is called at once. | ||
+ | // $.history.load(hash); | ||
+ | // return false; | ||
+ | }); | ||
+ | |||
+ | }); | ||
Revision as of 10:17, 21 July 2010
Ajax load
load 1
load 2
load 3
Loaded html: