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?

2 of 6 people (33%) answered Yes
Recently 2 of 6 people (33%) answered Yes

Entry

How do I pass a URL to a new window to be opened when an OK button on new window is clicked?

Apr 6th, 2008 18:46
ha mo, Colin Fraser, Christina Lewis,


Your question is somewhat vague, and I suspect that this is the reason
why it has not been answered before now. 
I would venture to suggest this is a standard button/window opener
operation. 
Using a form button only : 
<form>
<input type="button" onClick="location.href='thispage.htm'" value=
"ThisPage">
</form>
and so on for each page you want to go to. 
Alternatively you may want to try : 
<script>
function openwin(newLoc)
{
window.open(""+newloc+"","my_new_window",
"toolbar=no,location=yes,status=no,menubar=no,scrollbars=yes,resizable=no,width=400,height=400")
} </script>
<form>
<input type="button" value="ThisPage" onclick="openwin('thispage.htm')">
<input type="button" value="ThatPage" onclick="openwin('thatpage.htm')">
<form> 
This is much tidier.
Of course, all this depends on how you get the URL.
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