superfrog
08-09-2003, 01:42 PM
i am trying to make a link open a new page but i forgot the script or tag to do this.
i am when i user clink on a hyperlink, the target URL will be displayed on a new page.
know this sounds very elementry but i cant seem to figure this out =D
anyway can help me with this..
thanks
Burhan
08-09-2003, 02:23 PM
Two options ... use javascript :
<a href="#" onclick="window.open('myfile.html');">open in new window</a>
OR use target :
<a href="myfile.html" target="_new">open in new window</a>
Both should work.
bliang
08-09-2003, 02:31 PM
fyrestarter is correct, except i believe when using target, it should be set to target="_blank" if you want a new window each time the link is clicked.
Naturally, creating an arbitrary window target (i.e. "new") would result in that same popup window being changed each time.
... unless target="_new" is workable, too (maybe xhtml valid?). If it is please shout out.
Burhan
08-09-2003, 02:41 PM
I think "_blank" is correct, however, I read somewhere that any target that's prefixed with _ is reserved, and in some browsers _top takes you to the top of the page.
As far as the xhtml part goes, target is a valid xhtml attribute, so as long as your attribute values are quoted, and end tags are correctly nested, etc. you shouldn't have problems validating xhtml.
Like always, its best to test things out :)
superfrog
08-09-2003, 10:37 PM
thanks for the solutions =)
it is working now =)