JavaScript Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsWeb DesignJavaScript Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old July 19th, 2001, 01:24 PM
wolfespawn wolfespawn is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Feb 2001
Posts: 68 wolfespawn User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 13
Send a message via AIM to wolfespawn
Javascript- need to close current window and redirect....

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...

thanks.

Reply With Quote
  #2  
Old July 19th, 2001, 03:11 PM
phreq phreq is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2001
Location: New Zealand
Posts: 167 phreq User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 9 m 3 sec
Reputation Power: 13
which condition?

Hi,

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 --

<HTML>
<HEAD>
</HEAD>
<BODY>Original Page (page1.htm)<br>
<a href="page1.htm" onClick="window.open('popup.htm')">Click here to open new window</a>.
</BODY>
</HTML>

-- popup.htm --

<HTML>
<HEAD>
<script language="javascript">
function redirect()
{
if (document.popupForm.redirectMe.checked)
{
window.opener.location = "page2.htm";
window.close()
}
}
</script>
</HEAD>

<BODY>Popup Page (popup.htm)<br>
<form name="popupForm">
<input type="checkbox" name="redirectMe" value="redir" onClick="redirect()">If you check this box, the redirect occurs and this window closes.
</form>
</BODY>
</HTML>

-- page2.htm --

<HTML>
<HEAD>
</HEAD>
<BODY>Redirect Page (page2.htm)<br>
<a href="page1.htm">Click here to return to page1.htm</a>.
</BODY>
</HTML>

-- 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.



Jen

Reply With Quote
Reply

Viewing: Dev Shed ForumsWeb DesignJavaScript Development > Javascript- need to close current window and redirect....

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap