16 years
Here's an HTML code snippet from a website that I came across today as an example:
(I anonymized the code and removed irrelevant sections.)
[HTML]
my homepage
document.location.replace("Home.aspx");
[/HTML]
There are two types of redirect in the homepage code:
- Meta refresh redirect
- JavaScript redirect
This is the part that causes the meta refresh redirect -- it pauses 3 seconds and then redirects to a page called Home.aspx:
[HTML][/HTML]
This is the JavaScript redirect:
[HTML]
document.location.replace("Home.aspx");
[/HTML]
This is sloppy coding on the part of the developer. It's intended to redirect with JavaScript first, and if the user has JavaScript turned off it is supposed to redirect with the meta refresh redirect.
In Firefox 3 with the NoScript extension, neither redirect works and I just get a blank page. Also, both types of redirect are bad for search engine rankings.
This example wasn't on a hostel's website, but I've seen both types of redirects on hostel websites.
Log in to join discussion