This is going to be an extremely simple tutorial for you all. I know many people still don't understand XHTML in the respect of "why use it", but this tutorial is not to explain to you why, i believe mastercomputers explained it all in another topic. This topic is to tell you how to open another window while being XHTML 1.0, 1.1 valid.
This function when called upon will create and open a window which will take you to the website which has been given.
The above code has a variable within it called 'url', this is so that it knows that something is going to be used in order for the function to work correctly, in this case a website address.
This is the code to use it correctly:<a href="http://overture.uni.cc" onclick="launchit('http://overture.uni.cc'); return false;">Some Link</a>
As you can see the function is called upon using the onclick event within the anchor tag. I hear you say "what does the 'return false' do". This basically stops the focused window (the window which the link is on) to not go to that website as we want it to open in another window (that is the whole point of this tutorial).
The normal way to do this would be to use this code:target="_blank"This would open the window getting the url from within the href="".
This however is not valid XHTML and will return and error when it is checked. This is because the 'target' attribute is not supported in XHTML 1.0 or 1.1. I do believe it is in XHTML TRANSITIONAL (could someone verify that for me).
Well that is it. I believe this all works correctly. If not tell me the problem and i will try and correct yours or my mistake.
You can add more methods to XHTML. You can either load a DTD supporting target or add it to it inside the <!DOCTYPE>
What to add is:
[ <!ATTLIST a target CDATA #IMPLIED> ]
Notice that most browsers (including geckos and IE) show "]>" at the top of the page. This sucks but you can hide it using CSS change it to background-color. Also I believe it will disappear from Geckos at least. Opera does not show it.
Sorry, Hercco, not really understanding what you wrote. What does that tag do??
|VIEW DESKTOP VERSION||REGISTER||GET FREE HOSTING|