tebster
06-12-2008, 08:56 PM
Hi all,
I am not sure where i should have posted this question but as javascript is the norm for all queries, so i have posted it here.
I have a link that is controlled with html and css but upon a link click i want it to open in a new tab/window, rather than it closing my page to display the new page.
Please help - i love javascript but i am a junior.:confused:
Millenia
06-12-2008, 09:10 PM
I'm sorry, but to my knowledge this is impossible! It should be coming out soon, but tabbed browsing is up to the browser not the markup. You could force open a window using this:
<a href="http://www.yourlink.com" target="_blank">But if you just want to open it in a new tab rather than it doing it automatically. Right click the hyperlink and click 'Open in new tab'.
Thanks
(small edit: This thread doesn't belong here)
barkermn01
06-13-2008, 12:21 PM
Not only is the thread in the wrong place you need to name them better soem thing like
opening in new tab/window
would be alot easyer for people to help you
i am not having ago only saying coz ppl dont read threads with daft names
Philip M
06-13-2008, 02:07 PM
Not only is the thread in the wrong place you need to name them better soem thing like
opening in new tab/window
would be alot easyer for people to help you
i am not having ago only saying coz ppl dont read threads with daft names
Nor those with poor spelling, poor punctuation, textspeak and poor grammar.
Arty Effem
06-13-2008, 03:15 PM
I'm sorry, but to my knowledge this is impossible! It should be coming out soon, but tabbed browsing is up to the browser not the markup. You could force open a window using this:
<a href="http://www.yourlink.com" target="_blank">How the document is opened depends on the browser's configuration.
(small edit: This thread doesn't belong here)Technically it can belong here in that the target attribute isn't allowed with certain doctypes, but can be assigned with JavaScript.
<a href="http://www.yourlink.com" id="myLink">
<script type='text/javascript'>
doccument.getElementById('myLink').target='_blank';
</script>
abduraooft
06-13-2008, 03:23 PM
Technically it can belong here in that the target attribute isn't allowed with certain doctypes, but can be assigned with JavaScript. May be off topic, but we had a good discussion on this, see http://www.codingforums.com/showthread.php?t=117463