HTML help
17 posts
• Page 2 of 2 • 1, 2
shougan wrote:
- Code: Select all
<a href=""
target="_blank"> </a>
The only problem with using the target attribute is that it is not valid in the "Strict" document type HTML/XHTML.
So if you are interested in writing pages that conform to HTML 4.01 Strict, XHTML 1.0 Strict or XHTML 1.1 you will not [legally] be able to use the target attribute.
Since I try to use the Strict DTD's whenever I can I have found a few methods to get around the target attribute. One of them is extremely complex and I haven't used. It is only applicable to XHTML and involves extending the DTD to include a target attribute. It is a lot of work, but would technically be the "proper" way to achieve target like functionality (without JavaScript).
The second method is the easier method and involves a little bit of JavaScript. If the browser does not support JavaScript, then the link will open in the same window, so nothing is actually lost on old clients.
Lets say we want to create a link to slashdot.org . We want it to open in a new window. Lastly, we want it to conform to the Strict DTD's. The following code would accomplish our task.
- Code: Select all
<a href="http://www.slashdot.org" onclick="window.open(this.href); return false;">slashdot.org</a>
There you have it.
-Weaver
Public Keys
The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of pi change.
-- FORTRAN manual for Xerox Computers
The primary purpose of the DATA statement is to give names to constants; instead of referring to pi as 3.141592653589793 at every appearance, the variable PI can be given that value with a DATA statement and used instead of the longer form of the constant. This also simplifies modifying the program, should the value of pi change.
-- FORTRAN manual for Xerox Computers
- Weaver
- PROfessional Member
- Posts: 1967
- Joined: Wed Jun 19, 2002 12:05 am
- Location: /home/weaver/
Re: HTML help
imnuts wrote:I want to know if there is an html command that will open links in a new window when they are clicked. i think there is i just don't know what it is. if it can't be done with html, then what would i need to use to get the new window upon being clicked.
It's quite simple, the code for a simple URL is:
- Code: Select all
<a href="http://www.pro-networks.org">Open me in the same window!</a>
This takes the browser to www.pro-networks.org in the same window it is clicked in.
By adding the target="_blank" section to the hyperlink code will enabled it to open in a new window.
In case your still in doubt, the link to open www.pro-networks.org in a new window would be:
- Code: Select all
<a target="_blank" href="http://www.pro-networks.org">Open me in a new window!</a>
Hope this helps,
Kind Regards,
Neox.
LOL thnx for informing me Weaver...LOL Gues my websites need to be up to ur lvl..LOL thnx again man...
Do you want the latest news on Betas & Software, Security, or even Vista? Check out our <a href="http://www.pro-networks.org/forum/home_index.php" target="_blank" class="postlink">news areas</a> and be sure to <a href="http://www.pro-networks.org/main/newsletters.htm" target="_blank" class="postlink">subscribe to our PROneT newsletters!</a>
to proctect images, well it cant relley be done, there are codes that dis allow right clicking. but even then the images can still be aquired by goint to file>save as and that will save all links attached to that page, the only alternative that i have found is to put your image onto flash and make a swf, that way it connot be accuired
- SamTranter
17 posts
• Page 2 of 2 • 1, 2
Return to HTML, CSS, and Scripts
Who is online
Users browsing this forum: No registered users and 5 guests