I will be using Javascript so you can either put the code in an external file and link to it (remember to add the '/' before the '>'
This is the simple Javascript function we will be using:
function launchit(url) {
[tab][/tab]window.open(url);
}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.
overture.












