Forum Moderators: open

Message Too Old, No Replies

Stuck in a loop?

question from novice

         

sailorjwd

9:51 pm on May 1, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Is it possible for a visitor to my site to get stuck into a loop with the following frame breakout code? I have periodically had people appear to be refreshing the page every second (for hours at a time) and I'm wondering if it is me or them with the problem. Any help would be greatly appreciated.

<head>
<script type="text/javascript">
<!--

if( top!= self ){
top.location=self.document.location;
}

//-->
</script>
...

kaled

8:25 am on May 3, 2005 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



The code is faulty, but I would not like to predict the result.

Bear in mind that location is an object not a string.
Try the following. It will also ensure that the back button works correctly.

if (top!= self) top.location.replace(self.location.href);

Kaled.