Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Alternative to target="_blank" when using XHTML strict and no javascript!

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?

like image 795
AJM Avatar asked Jul 31 '09 10:07

AJM


2 Answers

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.

like image 134
Sampson Avatar answered Oct 19 '22 23:10

Sampson


You can only do this by:

  • Use Transitional doctype
  • or use JavaScript

Don't force new windows on visitors

like image 31
Tommy Avatar answered Oct 19 '22 22:10

Tommy