Menu
I want to open a link in a new window..however since I am using XHTML, this poses a new challenge for me.
Here is my link code:
[code=php]<a href=”glyph.htm” class=”link” target=”new”><img src=”images/glyphsmall.jpg” alt=”Glyph”/>
Now, as you can see the “target=”new” thing doesn’t work..so my page which validated won’t validate because of the target thing.
Now W3C says this about new window tags
[COLOR=darkred]{ target-new: tab ! important }
But where do I put this? In the area of my CSS or in the URL itself?
W3C.org is nice but they are horribly lacking in examples or clarification.
What is wrong with letting user decide where they what this link to be opened [/QUOTE]
[i]Originally posted by Dark Dragon [/i]
[B]What is wrong with designing it the way I need it?
I want to simplify my site. Do you actually have an answer for me or are you just going to criticize me? [/B][/QUOTE]
If you were not so selt-centered you would recognize an answer when one is given.[/QUOTE]
[i]Originally posted by samij586[/i]And for this too, for I think it's unethical to reply in contradict the hopes and questions of the original thread starter.
[b]so I will not be helping you[/b][/quote]
[size=1]
<a href="glyph.htm" class="link" [color=red]onclick="target='new';"[/color]><img src="images/glyphsmall.jpg" alt="Glyph"/></a>
[/size]
[i]Originally posted by Dark Dragon [/i]
[B]"onclick"???
Why didn't I think of that?
Thanks to you too Paul.
[/b][/quote]
[i]Originally posted by Dark Dragon [/i]
[B]By the way, would it work as a way to break out of a frameset? [/B][/QUOTE]
[i]Originally posted by Dark Dragon [/i]
[B]The code worked wonderfully Paul and it validates too ? [/B][/QUOTE]
<script type="text/javascript">
<!-- // Begin js
var url = "url_of_page";
if(window.location==url) {
} else {
window.location = url;
}
// -->
</script>
[i]Originally posted by omega [/i]
[B]as for frames, i think this'll work...
<script type="text/javascript">
<!-- // Begin js
var url = "url_of_page";
if(window.location==url) {
} else {
window.location = url;
}
// -->
</script>
That'll redirect to your page if the user has javascript and is on a framed page... if you want it on a url i would say target="_parent" but i don't know if that's valid or not... [/B][/QUOTE]
<i>
</i><script type="text/javascript">
if(parent.location != self.location) {
window.location = "page.html";
}
</script>
[i]Originally posted by The Cheat [/i]
[B]wait a second here. What about those people who have javascript disabled. Isn't it like 13% of the internet now?
Whats more important,
using javascript and having your menu not be functional to 13% of the internet
or
using target="_blank" and having it will be functional to everybody but your page not being 'valid' [/B][/QUOTE]
[i]Originally posted by The Cheat [/i]
[B]wait a second here. What about those people who have javascript disabled. Isn't it like 13% of the internet now?
Whats more important,
using javascript and having your menu not be functional to 13% of the internet
or
using target="_blank" and it will be functional to everybody but your page not being 'valid' [/B][/QUOTE]
[i]Originally posted by Dark Dragon [/i]
[B]I used Paul Jrs code and it worked really nice too.
I agree .....I dislike popup windows too..I thought it might have been a good idea to use it if I only have one image to display rather than opening it up in the same window..it kinda seemed like a waste.[/B][/QUOTE]
[i]Originally posted by artemisia [/i]
[B]unfortunately, if someone has an ad blocker..won't it block any javascript that attempts to open a new window of any sort? [/B][/QUOTE]
Generally, I believe most pop-up blockers will only block unrequested pop-ups. [/QUOTE]
[i]Originally posted by Dark Dragon [/i]
[B]I don't think that is entirely accurate though.
Even functional popups like the ones used on some Photoshop tutorials sites are blocked by AdSubtract.
But I just temporarily disable it so I can use it. [/B][/QUOTE]
0.1.9 — BETA 5.19