Hi, I dont know where to start with this really. I need an if statement which checks if the user is on the homepage. If they are then it shows some text and if not it doesn't. Any ideas? Cheers, Adam
Not sure why code like that is needed as you can do this via html/php or asp.net but here it is. (I haven't tested it yet) if (document.location=='http://www.mywebsite.com/') { document.write('You are on the homepage'); } Code (markup):
if(window.location.pathname="index.php") { alert('It is index'); }else { alert('Not an index.') } PHP: