Page 1 of 1

how to open a new window with a script?

Posted: Sat 12 Mar 2011 10:37 pm
by n9mfk
Hi all,
i need some help
im working on some code
that uses

Code: Select all

javascript:window.close();
I found that for this to work in firefox the page must be open with script
so I like to make a page with script that wood open another page
thanks for an help Beau

Re: how to open a new window with a script?

Posted: Sun 13 Mar 2011 4:08 am
by fractonimbus
Is this the sort of thing you mean?

Click on the "NINO 3.4 Index" heading:

http://www.deakinwx.com/wx/index.htm

DN

Re: how to open a new window with a script?

Posted: Sun 13 Mar 2011 12:51 pm
by daj
Various ways to do it. Use the onclick event of the a tag

Code: Select all

<a href="Javascript:" onclick="window.open('new_page.html','New Page');">Click Me</a.>
(The href="javscript:" is often written as href="#" which does nothing, but some browsers need something in the href for completeness! I prefer to use javascript as it stops the browswer putting a # in the URL)

a quick Google found this..http://www.javascript-coder.com/window- ... open.phtml