i have this javascript script shared between all my web pages:
if(document.location.pathname == '/' || document.location.pathname == '/index.php'){
window.hello='hello';
window.alert(window.hello);
}
else
{
window.alert(window.hello);
}
the window.hello variable should be (as far as i know) a cross page variable, so it should display 'hello' in every page (having first loaded index.php), but that happens only in the index page, while the others display 'undefined' .... someone knows why?