Re: Best way to break out of a frame (solution)
- From: Thomas 'PointedEars' Lahn <PointedEars@xxxxxx>
- Date: Sun, 10 Aug 2008 19:55:14 +0200
Jonas Smith wrote:
[...] David Mark wrote [...]:
On Aug 4, 12:30 pm, Jonas Smith <jonas.sm...@xxxxxxxxx> wrote:
On Mon, 28 Jul 2008 01:28:02 -0400, Jonas Smith wrote [...]:You are still breaking the back button! That is the single most
Thanks for the pointers, I made some changes and I am now waitingI'm now using:
for my volunteer tester to come back with results.
<body onLoad="if (window.self!=window.top) {window.top.location =
window.self.location;}">
annoying blunder that a JS developer can make (see any of Google's
properties for lots of bad examples.) Use location.replace to avert
this problem.
I guess you didn't read the whole thread from the start. The reason for
this little tidbit of code in each of my pages was to break out of a
frame whenever somebody else framed my site within their own and serving
ads along side my pages.
Do you think that I would care about the back button when that happens?
I couldn't care less if people could get back to the *** site.
Your reasoning is flawed. You would be punishing the innocent user who
happened to navigate to the offender's site (let us keep street language on
the streets, shall we?), not the offender themselves. Because if the user
activated the Back button on your site after being redirected there, they
would be getting back to the offender's site, and shortly after back to your
site again. And, in fact, if you used window.top.location.replace()
instead, as suggested, you could prevent the user from seeing the offender's
site again when navigating back, while still preserving the display of your
Web site as you want it to be (provided client-side script support is enabled).
BTW, alt.comp.lang.javascript is a dead newsgroup, please do not crosspost
to there.
PointedEars
--
Anyone who slaps a 'this page is best viewed with Browser X' label on
a Web page appears to be yearning for the bad old days, before the Web,
when you had very little chance of reading a document written on another
computer, another word processor, or another network. -- Tim Berners-Lee
.
- Prev by Date: Re: FAQ Suggestion
- Next by Date: Re: Learning Javascript
- Previous by thread: Question: XMLHttpRequest
- Next by thread: Re: Best way to break out of a frame (solution)
- Index(es):
Loading