July 19th, 2001, 01:24 PM
Im really new to JS...
when a small window opens, there is a condition when if met, i would like the window to redirect to another link and close itself...
i want it to redirect into the window which opened itself... not inside itself...
is this possible without any action event?
it would be on a page load or something? if this condition is met, then close.me and redirect?
if possible could someone post sample code?
it would be greatly appreciated...
July 19th, 2001, 03:11 PM
Um I'm not too sure what you mean by 'if the condition is met' - if you could let me know what you're trying to check for, I'll see if I can write the code for you.
In the meantime, here's an example that is kind of similar, it uses a function though. The popup redirects and closes if the checkbox is checked.
-- page1.htm --
<BODY>Original Page (page1.htm)<br>
<a href="page1.htm" onClick="window.open('popup.htm')">Click here to open new window</a>.
-- popup.htm --
window.opener.location = "page2.htm";
<BODY>Popup Page (popup.htm)<br>
<input type="checkbox" name="redirectMe" value="redir" onClick="redirect()">If you check this box, the redirect occurs and this window closes.
-- page2.htm --
<BODY>Redirect Page (page2.htm)<br>
<a href="page1.htm">Click here to return to page1.htm</a>.
-- end of script --
Hope that is of some help... as I say, if you post some more details I'd be happy to give it another go.