Team:TU Delft/header2

From 2010.igem.org

(Difference between revisions)
Line 31: Line 31:
<script type="text/javascript">
<script type="text/javascript">
-
 
-
//Global Vars
 
-
var activePage = "</html>{{{contentpage|home}}}<html>";
 
-
 
-
//On page load this function is called
 
-
$(function() {
 
-
 
-
});
 
-
 
-
function pageload(hash) {
 
-
 
-
// hash doesn't contain the first # character.
 
-
if(hash) {
 
-
var url = wgServer + "/Team:TU_Delft/" +hash+ "?action=render";
 
-
$.get(url, function(data) {
 
-
$("#load").html(data).fadeIn(200);
 
-
rewriteLinks($("#load"));
 
-
});
 
-
} else {
 
-
// start page
 
-
$("#load").empty();
 
-
}
 
-
}
 
-
 
-
 
-
function rewriteLinks(elem) {
 
-
 
-
$("a", elem).each(function(){
 
-
 
-
var isFound = $( this ).attr( 'href' ).toString().search( new RegExp( /Team:TU_Delft/i ) );
 
-
 
-
if(isFound > 0) {
 
-
this.href = this.href.replace("Team:TU_Delft/", wgPageName+ "#");
 
-
}
 
-
 
-
});
 

Revision as of 13:53, 21 July 2010