faqts : Computers : Programming : Languages : JavaScript

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

1 of 2 people (50%) answered Yes
Recently 1 of 2 people (50%) answered Yes

Entry

How do I open a brand new window in JS but keep the window.opener object null and unassiged?

Apr 7th, 2008 23:08
ha mo, Colin Fraser, Guy Carnegie,


ummmm I have had a quick look at this but have been unable to do it, not
without closing the window. This confirms my original premise that it
cannot be done easily, which is not a good point to start from. 
However, I am sure that there is no reason that would preclude using the
same window opener over and over again by simply assigning different
names to the opener function. eg:
<script type="text/javascript">
function openwindow(fname, wname)
{
window.open(""+fname+"",""wname+"",
"toolbar=yes,location=yes,directories=no,status=no,
menubar=yes,scrollbars=yes,resizable=no, 
copyhistory=yes,width=400,height=400")
} </script>
<form>
<input type="button" value="Open Window"
onclick="openwindow('index.htm','oneWin')">
<form>   
<a href="javascript:null()"
onclick="openwindow('2index.htm','twoWin')"><img src="linkimg.gif"></a>
and so on.
http://www.businessian.com
http://www.computerstan.com
http://www.financestan.com
http://www.healthstan.com
http://www.internetstan.com
http://www.moneyenews.com
http://www.technologystan.com
http://www.zobab.com
http://www.healthinhealth.com