Team:TU Delft/header2

From 2010.igem.org

(Difference between revisions)
Line 54: Line 54:
function () { $(this).removeClass("hover"); }
function () { $(this).removeClass("hover"); }
);
);
 +
 +
if (console === undefined) {
 +
console = {log:function(a){}};
 +
}
});
});
Line 79: Line 83:
function historyCallback(hash) {
function historyCallback(hash) {
-
//alert('historyCallback: ' + hash);
+
console.log('historyCallback: ' + hash);
// hash doesn't contain the first # character.
// hash doesn't contain the first # character.
if(hash) {
if(hash) {
if(hash.split('=').length == 1) {
if(hash.split('=').length == 1) {
-
alert('load hash as page: ' + hash);
+
console.log('load hash as page: ' + hash);
loadPage(hash);
loadPage(hash);
} else {
} else {
    var kvmap = splitHash(hash);
    var kvmap = splitHash(hash);
if (kvmap.page) {
if (kvmap.page) {
-
alert('load hashmap.page: ' + kvmap.page);
+
console.log('load hashmap.page: ' + kvmap.page);
loadPage(kvmap.page);
loadPage(kvmap.page);
} else if(kvmap.anchor)  {
} else if(kvmap.anchor)  {
-
alert('scrolling to anchor: ' + kvmap.anchor);
+
console.log('scrolling to anchor: ' + kvmap.anchor);
window.scrollTo(0, $(kvmap.anchor).position().top);
window.scrollTo(0, $(kvmap.anchor).position().top);
}
}

Revision as of 14:03, 22 July 2010