954,174 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

javascript Iframe PopUp help

I am implementing a popup with javascript which fire when the page is closed . I am using the unload() page handler. The problem is that the popup does not stays ... it popups for a while but then the new page loads.

I want it to stay there until user presses cancel..

Thanks

darktangent
Newbie Poster
13 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

Give me some code please. I don't think it dissapeares like that. I implemented once something like that and it worked well for me. Some code should help me help you :).

Clawsy
Posting Whiz in Training
225 posts since Feb 2008
Reputation Points: 11
Solved Threads: 7
 

you actually want your site blacklisted
you want to open a window to override user actions
Not a particularly good idea

almostbob
Posting Sensei
3,147 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
 

actually it is not a window it is an iframe pop up.. like saying GoodBye to user...
Actually i am firing a function to show a MOOdle popup.
Here is the code.
I donot know whats wrong with it..

It starts to appear and then vanishes.

<html>
<head>
<title></title>

<script type="text/javascript" src="javascript/moodalbox121compressed/js/mootools.js"></script>
<script type="text/javascript" src="javascript/moodalbox.js"></script>
<script type="text/javascript" src="javascript/modalbox.js"></script>
<link href="javascript/moodalbox.css" rel="stylesheet" type="text/css" media="screen">
<script type="text/javascript">
window.onbeforeunload = popup;
function popup(){
MOOdalBox.open( "popup.htm","Some kind of caption", "450 305" )
}</script>

</head>
<body>
darktangent
Newbie Poster
13 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

Well, it's all about how that moodle dialog works. I was talking about unload event on and use of an alert() message. Try using window.stop() function from javascript (to stop the browser) and after you press OK or close the dialog use window.location.href="new_location" to redirect the browser. I can be wrong.. stop doesn't always work on all browsers... but I try to help somehow :).

Clawsy
Posting Whiz in Training
225 posts since Feb 2008
Reputation Points: 11
Solved Threads: 7
 

the window.stop also does not works...
The popup loads but there is just a flash and then it vanishes...
I want it to load completely.

darktangent
Newbie Poster
13 posts since Jan 2010
Reputation Points: 10
Solved Threads: 0
 

why an external file
could you use unload to change the visibility of a layer in the page's css without the extra time needed to download the file

almostbob
Posting Sensei
3,147 posts since Jan 2009
Reputation Points: 571
Solved Threads: 376
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You