943,147 Members | Top Members by Rank

Ad:
Feb 12th, 2010
0

javascript Iframe PopUp help

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
darktangent is offline Offline
13 posts
since Jan 2010
Feb 12th, 2010
0
Re: javascript Iframe PopUp help
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 .
Reputation Points: 11
Solved Threads: 7
Posting Whiz in Training
Clawsy is offline Offline
225 posts
since Feb 2008
Feb 12th, 2010
0
Re: javascript Iframe PopUp help
you actually want your site blacklisted
you want to open a window to override user actions
Not a particularly good idea
Reputation Points: 561
Solved Threads: 365
Posting Maven
almostbob is online now Online
2,966 posts
since Jan 2009
Feb 12th, 2010
0
Re: javascript Iframe PopUp help
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.
JavaScript / DHTML / AJAX Syntax (Toggle Plain Text)
  1. <html>
  2. <head>
  3. <title></title>
  4.  
  5. <script type="text/javascript" src="javascript/moodalbox121compressed/js/mootools.js"></script>
  6. <script type="text/javascript" src="javascript/moodalbox.js"></script>
  7. <script type="text/javascript" src="javascript/modalbox.js"></script>
  8. <link href="javascript/moodalbox.css" rel="stylesheet" type="text/css" media="screen">
  9. <script type="text/javascript">
  10. window.onbeforeunload = popup;
  11. function popup(){
  12. MOOdalBox.open( "popup.htm","Some kind of caption", "450 305" )
  13. }</script>
  14.  
  15. </head>
  16. <body>
Last edited by darktangent; Feb 12th, 2010 at 2:29 pm.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
darktangent is offline Offline
13 posts
since Jan 2010
Feb 12th, 2010
0
Re: javascript Iframe PopUp help
Well, it's all about how that moodle dialog works. I was talking about unload event on <body> 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 .
Reputation Points: 11
Solved Threads: 7
Posting Whiz in Training
Clawsy is offline Offline
225 posts
since Feb 2008
Feb 12th, 2010
1
Re: javascript Iframe PopUp help
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.
Reputation Points: 10
Solved Threads: 0
Newbie Poster
darktangent is offline Offline
13 posts
since Jan 2010
Feb 12th, 2010
0
Re: javascript Iframe PopUp help
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
Reputation Points: 561
Solved Threads: 365
Posting Maven
almostbob is online now Online
2,966 posts
since Jan 2009

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in JavaScript / DHTML / AJAX Forum Timeline: making thing bigger
Next Thread in JavaScript / DHTML / AJAX Forum Timeline: jQuery ScrollShow customization to include description for images to scroll also





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC