Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

open page in new window

Status
Not open for further replies.

dcarbone

Programmer
Aug 22, 2003
29
CA
i'm using this script to open a new window on click, but the page that contains the link does not stay after closing the popup window, it switches to a blank page. how do i make the browser stay on that page.

<SCRIPT LANGUAGE=&quot;JavaScript&quot;>
function openindex()
{
OpenWindow=window.open(&quot;&quot;, &quot;newwin&quot;, &quot;height=250, width=250,toolbar=no,scrollbars=&quot;+scroll+&quot;,menubar=no&quot;);
OpenWindow.document.write(&quot;<TITLE>Title Goes Here</TITLE>&quot;)
OpenWindow.document.write(&quot;<BODY BGCOLOR=pink>&quot;)
OpenWindow.document.write(&quot;<h1>Hello!</h1>&quot;)
OpenWindow.document.write(&quot;This text will appear in the window!&quot;)
OpenWindow.document.write(&quot;</BODY>&quot;)
OpenWindow.document.write(&quot;</HTML>&quot;)

OpenWindow.document.close()
self.name=&quot;main&quot;
}
</SCRIPT>



 
what does the link look like?

try something like so:

<a href=&quot;#&quot; onclick=&quot; openindex(); return false;&quot;>link</a>

=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
the link is <a href=&quot;page.asp&quot;>link</a>

I tried that link, but i get error on page
 
also, how would i pass a variable to that page
 
>> &quot;the link is <a href=&quot;page.asp&quot;>link</a>&quot;

where is your call to openindex()?



=========================================================
-jeff
try { succeed(); } catch(E) { tryAgain(); }
 
its on the same page as the code for openindex
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top