PDA

View Full Version : window.location without actually going there!


java_jedi
09-16-2002, 09:46 PM
I want to write a script that creates "fake" subdomains to my site. I could write a script like this:

if (window.location == "http://something.somedomain.com/")
{
window.location="http://www.somedomain.com/something";
}

Now, I want to fool my visitors so it looks like they are still at something.somedomain.com.
Is there any way I can write to the location box WITHOUT directing the browser to actually go there?

Roy Sinclair
09-16-2002, 10:06 PM
No, you cannot do that for a very good reason. Just imagine clicking on a link that some site helpfully provided to yourbank.com so you could do some banking. However the link actually takes to you nastyhacker.com site instead but they use the trick you want so it looks like you're at yourbank.com and you go ahead and start giving out information that you'd never want anyone but yourself to know.

The basic point is that you don't want it possible for site A to ever be able to completely appear as site B, something somewhere ought to give site A away no matter how carefully they mimic the look and feel of site B.