Forum Moderators: open
<script type="text/javascript">
other with:
<script language="javascript">
yet other with:
<script typ="text/javascript" language="JavaScript">
String alternatives include:
if (top!= self)
top.location.href = self.document.location;
if (parent!= self)
{top.location.href = location.href}
if (top.frames.length!=0)
top.location=self.document.location;
if (window!= window.top)
top.location.href = location.href;
if (self!= top) top.location.href = self.location.href;
if (parent.frames.length > 0) {
parent.location.href = location.href;
}
if (top.location!= location)
top.location.href = document.location.href ;
if (top!= self) top.location.href = location.href;
jdMorgan has an interesting and rather recent solution at:
[webmasterworld.com...]
EVERY script I have seen is different! Why? My own site is unframed and like most I would only need something simple that works in modern browsers and preferrably does not disable the Back button.
Finally, I also found this:
<meta http-equiv="window-target" content="_top">
It would be nice if it works, as some people browse JS disabled. Could having both Meta and Script on my page solve that problem?
Simply because there is more than one way to get the job done.
I like to put javascript in extenal files and call the code with a one-liner in the <head> section, javascript being the last stuff in the head section before the ending </head> tag.
.
Just look at Windows. To close a window: use Alt-F4, or click the X at top-right, or click the image at top-left and then click "Close" in the drop down list that appears, or press Control-X, or...
" You should always use location.replace(newurl) otherwise the back button breaks."
Very good advice! I did exactly that from earlier advice you kindly provided.
I tried various methods but your's was the best.
There is only one downside, my _apparent_ hits counts dropped.
Why? Because formerly, people would back out of my framed page, only to wind up in
the referring page .. back and forth endlessly!
Now, they end up in a new window and the tennis-ball effect is eliminated.
Sure, my hit counts are lower, but they are also more realistic. Thanks again - Larry
[webmasterworld.com...]
I hope this isn't too divergent from the main thread here. But!
How do you feel when some valued page(s) of yours are framed by another site?
Personally, I feel somehow insulted or ripped off.
It is as if the other site is including your or my work as a part of theirs..
that they somehow own your works.
I hope that the major SEs pass PR and any other credits normally given
via a straight link to any site that is "framed".
Not to do so would be an injustice to the browsing public, not to mention the source. - Larry
The language="javascript" is an older attribute, for some ancient browser (IE3?, NS3?, NS4?, so long ago I no longer remember), and can be left out if you want.
Add a DOCTYPE above the first <html> tag, and then run the page through [validator.w3.org ] to make sure there are no other HTML coding errors.
I hope this isn't too divergent from the main thread here. But!
How do you feel when some valued page(s) of yours are framed by another site?
Larry, I use a frame-busting script on every single page of every site I control - I dislike any framing of my contents under almost any circumstances. I don't think I'm the only person here with that opinion!