Team:TU Delft/header2
From 2010.igem.org
(Difference between revisions)
Line 37: | Line 37: | ||
$(function() { | $(function() { | ||
// Initialize history plugin. | // Initialize history plugin. | ||
- | $.history.init( | + | $.history.init(historyCallback); |
rewriteLinks($("#navlist")); | rewriteLinks($("#navlist")); | ||
Line 71: | Line 71: | ||
} | } | ||
- | function | + | function loadPage(page) |
+ | { | ||
+ | var url = wgServer + "/Team:TU_Delft/" +kvmap.page+ "?action=render"; | ||
+ | $("#load").fadeOut(200); | ||
+ | $.get(url, function(data) { | ||
+ | $("#load").html(data).fadeIn(200); | ||
+ | rewriteLinks($("#load")); | ||
+ | }); | ||
+ | } | ||
+ | |||
+ | function historyCallback(hash) { | ||
// hash doesn't contain the first # character. | // hash doesn't contain the first # character. | ||
if(hash) { | if(hash) { | ||
- | + | if(hash.split('=').length == 0) | |
- | + | loadPage(hash); | |
- | + | else { | |
- | + | var kvmap = splitHash(hash); | |
- | + | if (kvmap.page) loadPage(kvmap.page); | |
- | + | } | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | } | + | |
} else { | } else { | ||
// start page | // start page |
Revision as of 11:48, 22 July 2010