Forum Moderators: not2easy
<a class="menu-right" target="_blank" href="http://www.example.com/">Example</a>
The key here is that I want to have this link open up to a new browser.
[edited by: createErrorMsg at 5:49 pm (utc) on Sep. 10, 2005]
[edit reason] examplified url [/edit]
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
cEM
Too slow. ;)
target="blank", then you shold use HTML 4.01 Transitional, where it is valid. Otherwise, you are either jumping through hoops unneccessarily to trick the validator into thinking your page is valid (which is totally pointless) or you are sacrificing a desired functionality just to adhere to a particular HTML specification (which is equally pointless). There is no disadvantage in going for a transitional doctype, and no reason not to if you need to.
That didn't work but of course I probably made a mistake somewhere. Also, will it work for those that have java turned off. If not, then I best go back to Loose.
The reason I am using Strict is that evently I want to transform over the XHTML. When I do, will XHTML allow such practice or will a javascript be needed?
If moderator wish, he/she can move the topic over to the appropiate forum.
[edited by: createErrorMsg at 6:27 pm (utc) on Sep. 10, 2005]
[edit reason] examplified url [/edit]
target="_blank" also, so you have no problems there. And anyway, the worst possible scenario with a user agent which suddenly decided to stop supporting target would be that the page would open in the same window - which is hardly a catastrophe. Using Javascript as you have indicated would not function with Javascript disabled, so it would be a bad idea.
That didn't work
My mistake. You have to put the url in single quotes...
<a href="javascript:window.open('myURL.htm');">Link Text</a>
Using Javascript as you have indicated would not function with Javascript disabled, so it would be a bad idea.
Agreed. Was just presenting it as an option given newseeds desire to stick with the Strict doctype. If a Strict doctype and validation are requirements, JS is the only way to go. But with JS disabled the link will not function at all. I, like encyclo, would not recommend this option, but it's good to be aware that it exists.
Listen to encyclo, he really knows what he's talking about here...which doctype you use is not as important as following the rules of whichever doctype you choose. It's far better to identify your coding needs and select the appropriate doctype, than it is to sacrifice functionality in the name of using the "right" doctype.
cEM