Solved

redirect after popup

Posted on 2010-08-20
8
507 Views
Last Modified: 2012-05-10
hello
what i am trying to is when a user logs out, popup a box saying you have logged out etc then load a redirect to the login page. can someone look at my code and tell me why it just redirects and the popup never happens? if i reove the redirect popup works fine. many thanks
<script type="text/javascript">
			//<![CDATA[
				$.setupJMPopups({
					screenLockerBackground: "#003366",
					screenLockerOpacity: "0.7"
				});

				function openStaticPopup() {
					$.openPopupLayer({
					name: "mySecondPopup",
					width: 550,
					target: "myHiddenDiv"
				});

				}
			//]]>
		</script>
		<script type="text/javascript">
				<!--
				window.location = "/sample/index.php"
				//-->
		</script>
		<div id="myHiddenDiv">
			<div class="popup">
				<div class="popup-header">
					<h2>Logistor Logout</h2>
					<a href="javascript:;" onclick="$.closePopupLayer('mySecondPopup')" title="Close" class="close-link">Close</a>
					<br clear="all" /><br /><br />
				</div>
				<div class="popup-body">
					<code>
						<pre>
								This is just a test
						</pre>
					</code>
			</div>
		</div>
		</div>

Open in new window

0
Comment
Question by:peter_coop
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
8 Comments
 
LVL 3

Expert Comment

by:mahadazad
ID: 33488026
The reason is very clear; when the page loads it is redirected instantly... You could do one thing, on the page load show the popup... and on the popup close event redirect the page.
0
 

Author Comment

by:peter_coop
ID: 33488480
hi. wanted to redirect while the popup was still active and let them close it. thanks
0
 
LVL 53

Expert Comment

by:Huseyin KAHRAMAN
ID: 33489180
what about a simple solution like this

<script>
alert("Goodbye, come back!");
window.location = "http://google.ca";
</script>
0
PeopleSoft Has Never Been Easier

PeopleSoft Adoption Made Smooth & Simple!

On-The-Job Training Is made Intuitive & Easy With WalkMe's On-Screen Guidance Tool.  Claim Your Free WalkMe Account Now

 

Author Comment

by:peter_coop
ID: 33489205
problem with that solution hainkurt is that it also closes the popup which i want to keep on top and let the client close the popup. i am using the code below which is called from this:

onload="openStaticPopup()"

many thanks
function openStaticPopup() {
	$.openPopupLayer({
	name: "mySecondPopup",
	width: 550,
	target: "myHiddenDiv",
	success: function() {
								window.location = '/sample/index.php';
								}
				});

Open in new window

0
 
LVL 53

Accepted Solution

by:
Huseyin KAHRAMAN earned 250 total points
ID: 33489260
ok do this...
on your popup

window.opener.window.location = '/sample/index.php';

and use this to open popup
function openStaticPopup() {
	$.openPopupLayer({
	name: "mySecondPopup",
	width: 550,
	target: "myHiddenDiv",
});

Open in new window

0
 

Author Comment

by:peter_coop
ID: 33489339
i am already doing that from the onload event. have i misunderstood u? thanks
0
 
LVL 53

Expert Comment

by:Huseyin KAHRAMAN
ID: 33490320
you run redirect from popup page in my suggested solution above
0
 

Author Closing Comment

by:peter_coop
ID: 33490863
thank you
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
jQuery is a JavaScript library that greatly simplifies JavaScript programming. AJAX is an acronym formed from "Asynchronous JavaScript and XML."  AJAX refers to any communication between client and server, when the human client does not observe a…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question