views:

1213

answers:

5

I need to use XHTML strict

I need to ensure my site works with no javascript.

I need to open a new help window from my own application. Of course I wanted to use target="_blank" when no javascript detected but this is not XHTML strict.

Are there any alternatives?

+5  A: 

You can only do this by:

  • Use Transitional doctype
  • or use JavaScript

Don't force new windows on visitors

Tommy
I need to use XHTML strictI need to ensure my site works with no javascript.
AJM
@AJM: and how exactly does it not "work" if you can't force a new window? What's wrong with letting the user decide which links to open in a new window?
Joachim Sauer
Who are these monsters disallowing the use of Javascript!
Brian
A lot of project managers and sales people don't want the visitor to leave their page. I hear it all the time.
Tommy
+5  A: 

You have to use javascript in this case. If you don't want to use javascript, and still have valid markup, don't use XHTML Strict as your doctype.

document.getElementById("mylink").target = "_blank";

Or you can attach a click-event to the link that opens the address up in a new window. Either way, javascript is your solution if you want valid markup.

Jonathan Sampson
without using javascript and still XHTML Strict?
Tommy
I was wondering, the title does say with *no* javascript.
Kezzer
The title was *asking*. It's not possible without javascript.
Jonathan Sampson
Yes its client driven and my hands are tied!
AJM
@AJM, You can either use XHTML Strict + Javascript, or a less-strict doctype without javascript.
Jonathan Sampson
Thought so, Im doing the javascript thing already. This is for degrading.
AJM
@AJM, Let your client know that this is the standard in the professional world. There's nothing they need to be worried about.
Jonathan Sampson
+1  A: 

Take a read of this link. It talks about your issue. Link

Brian
Seems to me like a decent solution.
joelpet
A: 

Actually, there may be a way to do this without javascript. You can write a custom DTD as described here.

Add a target attribute to your customization and it will validate. I just came up with this idea and I'm not sure if I'm missing any drawbacks.

buzzspree
A: 

Try to use this:

http://www.webaddress.com' target='_blank'

as the address.

IT Ctrl
The question is ALTERNATIVE to target='_blank'
AJM