J
Jonas Smith
When I started my site a long time ago, I found out that some other site
was framing my site and serving ads around it, even though I had no ads.
At the time as a solution (and it worked) I added the following
Javascript statement to all my html files:
<body onload="if (window != window.top) {top.location.href =
location.href;}">
That surely breaks frames.
However, recently, few of my users have complained that the site keeps
reloading when accessed with a blackberry. All pages keep reloading
until stopped. I found the culprit to be the above JS statement.
I'm not a programmer by any stretch of the imagination so I have no clue
how to fix the behaviour for them.
I tried:
if (window != window.top) {top.location.href = location.href;} else {
alert('we are top');}
but I never seen the alert on any browser even when the window contained
no framing. So it seems that the window != window.top is always
evaluating to true.
I appreciate any clues or pointers to fix this issue.
TIA
was framing my site and serving ads around it, even though I had no ads.
At the time as a solution (and it worked) I added the following
Javascript statement to all my html files:
<body onload="if (window != window.top) {top.location.href =
location.href;}">
That surely breaks frames.
However, recently, few of my users have complained that the site keeps
reloading when accessed with a blackberry. All pages keep reloading
until stopped. I found the culprit to be the above JS statement.
I'm not a programmer by any stretch of the imagination so I have no clue
how to fix the behaviour for them.
I tried:
if (window != window.top) {top.location.href = location.href;} else {
alert('we are top');}
but I never seen the alert on any browser even when the window contained
no framing. So it seems that the window != window.top is always
evaluating to true.
I appreciate any clues or pointers to fix this issue.
TIA