CharisKomos (Talk | contribs) |
CharisKomos (Talk | contribs) |
||
Line 1: | Line 1: | ||
var master = sessionStorage.getItem('KEY'); | var master = sessionStorage.getItem('KEY'); | ||
+ | console.log('master :' + master); | ||
− | if( | + | if(document.location.href !== 'https://2017.igem.org/Team:Greece/' + master){ |
sessionStorage.setItem('LINK', master); | sessionStorage.setItem('LINK', master); | ||
+ | console.log('true'); | ||
+ | }else{ | ||
+ | console.log('False:' + document.location.href); | ||
} | } | ||
var link = sessionStorage.getItem('LINK'); | var link = sessionStorage.getItem('LINK'); | ||
+ | |||
if(link) history.replaceState(null, null, link); | if(link) history.replaceState(null, null, link); |
Revision as of 15:57, 23 September 2017
var master = sessionStorage.getItem('KEY'); console.log('master :' + master);
if(document.location.href !== 'https://2017.igem.org/Team:Greece/' + master){
sessionStorage.setItem('LINK', master); console.log('true');
}else{
console.log('False:' + document.location.href);
}
var link = sessionStorage.getItem('LINK');
if(link) history.replaceState(null, null, link);
/*var str = document.referrer; var redirection = true; var link = sessionStorage.getItem('LINK');
if('https://2017.igem.org/Team:Greece/'.length < str.length){
var newstr = str.substr(str.indexOf('Greece/')+7, str.length);
if(performance.navigation.type == 0){
switch(newstr){
case 'Model': redirection= false; break; case 'human_practices': redirection= false; break; case 'Achievements': redirection= false; break; case 'Team': redirection= false; break; case 'Project': redirection= false; break;
}
if(redirection){
console.log('Just created: ' + newstr);
$('#' + newstr).css('display', 'block');
history.replaceState(null, null, newstr);
}else{
console.log('No action must be taken'); }
}
}
- /