Forum Moderators: open
Line: 15
Char: 1
Error: Object expected
Code: 0
url:http://www.mydomain.com/folder/file.htm
Most of my pages contain this javascript, intended to autodirect random hits to the index page -
<SCRIPT LANGUAGE="JavaScript">
<!--
if (top == self) self.location.href = "index.htm";
// -->
</SCRIPT>
Everything works, but I don't like the error appearing. Is the problem with the javascript, because that is the only common content. Hope someone can help - thanks!
Welcome to Webmaster World!
It looks like your site uses frames, right? The script looks like it is supposed to put users back in the frameset if they came into a content page without the frame.
In any case, try changing it to this:
<SCRIPT type="text/javascript">
<!--
if (top == self.parent) self.location.href = "index.htm";
// -->
</SCRIPT>
Birdman