| |
|
 |
New windows without using the target attribute by: sm0ke |
Page: 1 of 2 (View All) |
[b]Introduction[/b]
Should we open links in a new window? or should we give the user a choice?
This is in fairness quite a hotly debated argument in certain circles, to force a users hand or to let them choose. A lot of people against the idea of opening links in a new window say that the user can right click the link and choose to open a new window or not. Personally I dont see more than 4% of my users knowing they can do this (based on experience).
As you may or may not know, when writing web documents in XHTML using a Strict doctype, the commonly used [b]target="_blank"[/b] attribute of the anchor tag (used to force links to open in a new window) is no longer valid. So we need a new way to accomplish it.
I'm going to show you two ways of opening the links in a new window, both require the user to have javascript enabled but the second methos will still create a functioning link which opens ion the same window if javascript is disabled.
[b]JavaScript popup[/b]
Paste the following code between the tags of your page:
[code]
[/code]
Next we need to create the link. Paste the following between the tags of your page:
[code]
This is the link text
[/code]
Ok, thats the first method done with, its quick, easy and painless.
No Comments for this page.
|
 |
Tutorial Stats |
| 491 |
Views |
| 0 |
Total Comments |
| 0 |
Rating of 5 ( Votes) |
|