By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,528 Members | 1,345 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,528 IT Pros & Developers. It's quick & easy.

javascipt to bust out of iframe

P: n/a
Hi all,

I want to display advertising in iframe, but bust out of iframe if someone
clicks on any of the links in there. Can u please help. I googled for it,
but I am not sure about the solution that works, and I am not a js expert.

Thanks,

steve
Jun 27 '08 #1
Share this Question
Share on Google+
7 Replies


P: n/a
noob wrote:
I want to display advertising in iframe, but bust out of iframe if someone
clicks on any of the links in there. Can u please help. I googled for it,
but I am not sure about the solution that works, and I am not a js expert.
Just add target="_blank" to the links. That will make them open in a new
window.
Jun 27 '08 #2

P: n/a
rfr
Unfortunatley, I don't think that use of "target" will pass the WC3
validator. That menas you will not be able to use validation to check your
code to be sure it is up to standards and hopefully more cross-bowser.

I, also, have been wondering what to use now to do this sort of thing that
"target" is off the acceptible use list.

"Stevo" <no@mail.invalidwrote in message
news:g2*************@news.t-online.com...
noob wrote:
>I want to display advertising in iframe, but bust out of iframe if
someone clicks on any of the links in there. Can u please help. I
googled for it, but I am not sure about the solution that works, and I am
not a js expert.

Just add target="_blank" to the links. That will make them open in a new
window.

Jun 27 '08 #3

P: n/a
rfr wrote:
Unfortunatley, I don't think that use of "target" will pass the WC3
validator. That menas you will not be able to use validation to check your
code to be sure it is up to standards and hopefully more cross-bowser.

I, also, have been wondering what to use now to do this sort of thing that
"target" is off the acceptible use list.
[snip]

Why would it fail to pass the validator? It's defined in the DTD

http://www.w3.org/TR/html401/sgml/loosedtd.html#Coords
(I know that's a link to Coords, but it's just below that)

See also

http://www.w3.org/TR/html401/present...ml#adef-target
Jun 27 '08 #4

P: n/a
Dan Rumney <da*******@warpmail.netwrites:
rfr wrote:
>Unfortunatley, I don't think that use of "target" will pass the WC3
validator. That menas you will not be able to use validation to
check your code to be sure it is up to standards and hopefully more
cross-bowser.

I, also, have been wondering what to use now to do this sort of
thing that "target" is off the acceptible use list.

[snip]

Why would it fail to pass the validator? It's defined in the DTD
It is defined in the transitional DTD but not in the strict one.

--
Joost Diepenmaat | blog: http://joost.zeekat.nl/ | work: http://zeekat.nl/
Jun 27 '08 #5

P: n/a
In comp.lang.javascript message <Sa2dnX8T_fKOF9TVnZ2dnUVZ_qqgnZ2d@prairi
ewave.com>, Fri, 6 Jun 2008 14:03:45, rfr <rf******@iw.netposted:
>Unfortunatley, I don't think that use of "target" will pass the WC3
validator. That menas you will not be able to use validation to check your
code to be sure it is up to standards and hopefully more cross-bowser.
A single expected failure does disallow use of the "valid" logo; but it
does not prevent the rest of the page being checked. To make sure, do
an occasional test with target not used.

If JavaScript is available, I suppose one could add the target attribute
by script, or write the whole link by script.

--
(c) John Stockton, nr London UK. ?@merlyn.demon.co.uk BP7, Delphi 3 & 2006.
<URL:http://www.merlyn.demon.co.uk/TP/BP/Delphi/&c., FAQqy topics & links;
<URL:http://www.bancoems.com/CompLangPascalDelphiMisc-MiniFAQ.htmclpdmFAQ;
Via <URL:http://support.codegear.com/newsgroups/>: news:borland.* Guidelines
Jun 27 '08 #6

P: n/a
VK
On Jun 8, 12:07 am, Dr J R Stockton <j...@merlyn.demon.co.ukwrote:
In comp.lang.javascript message <Sa2dnX8T_fKOF9TVnZ2dnUVZ_qqgnZ2d@prairi
ewave.com>, Fri, 6 Jun 2008 14:03:45, rfr <rfroh...@iw.netposted:
Unfortunatley, I don't think that use of "target" will pass the WC3
validator. That menas you will not be able to use validation to check your
code to be sure it is up to standards and hopefully more cross-bowser.

A single expected failure does disallow use of the "valid" logo; but it
does not prevent the rest of the page being checked. To make sure, do
an occasional test with target not used.

If JavaScript is available, I suppose one could add the target attribute
by script, or write the whole link by script.
That would be clearly a childish behavior: "it is OK to do if daddy
cannot see it". W3C Validator doesn't really validate anything for a
longest time by now anyway. With some caution it can be still used as
a markup errors checker, as well as HTML Tidy can be. Outside that its
HTML part is just a curious artifact of W3C ideas about the future of
the Web as they had them in 1998-99

At the modern time the DOCTYPE is only used for the mode switch with
two doctypes covering all needs:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"for
BackCompat mode
<!DOCTYPE htmlfor CSS1Compat mode

See also:
http://www.w3.org/TR/html5/#the-doctype
http://www.w3.org/TR/html5/#the-initial

Jun 27 '08 #7

P: n/a
VK wrote:
W3C Validator doesn't really validate anything for a longest time by now
anyway. [...]
Evidently, you do not have a single clue what you are talking about.
At the modern time the DOCTYPE is only used for the mode switch with two
doctypes covering all needs: <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01
Transitional//EN"for BackCompat mode
Valid, but recommended against *because* of the DOCTYPE switch that
triggers even more different rendering behavior among user agents.
<!DOCTYPE htmlfor CSS1Compat mode
Not Valid HTML 4.01, though.
See also: http://www.w3.org/TR/html5/#the-doctype
http://www.w3.org/TR/html5/#the-initial
This is ridiculous. You are referring to an *incomplete* *draft*
for HTML *5* that (obviously) lacks wide support.
F'up2 comp.infosystems.www.authoring.html

PointedEars
--
Prototype.js was written by people who don't know javascript for people
who don't know javascript. People who don't know javascript are not
the best source of advice on designing systems that use javascript.
-- Richard Cornford, cljs, <f8*******************@news.demon.co.uk>
Jun 27 '08 #8

This discussion thread is closed

Replies have been disabled for this discussion.