Popup On Exiting Site Or On Closing Window
Nov 9, 2003
I have spent the whole of last night looking for a reliable javascript that pops up a small (possibly centered) window when the user exits the site (for another site) and for when he/she closes the site's main window.
Has anybody come across or is aware of a script that does all the above?
View 3 Replies
ADVERTISEMENT
May 21, 2010
I am calling a Java Script function on the button click of a pop up window (ASP.net). The function does the following:
1. Close the Popup window
2. Call JS function on the Parent window
3. Try to open another popup
I am able to close the popup window and call the js function on the parent window but I am not able to open the new window.
CODE:
window.close();
window.opener.clearfields();
window.open('MyExcel.xls');
I need to perform all these in one JS function.
View 2 Replies
View Related
Jul 20, 2005
I want to close a popup-window with the onBlur eventHandler.
function closeIt() {
setTimeout('window.close()',2000); }
<body onBlur="closeIt()">
html
</body>
There is a form on my page, and when a input-field gets focus, body looses focus and the window closes. That's not what I want. I want to close the window, if focus goes to another
window or application, but not when someone tries to fill that form.
View 2 Replies
View Related
Sep 23, 2010
I need to open a popup window from a PHP site and pass in some parameters to use in the pop up window. I have the params in an input box and need to get the val of the box into a param and pass it to the new popup window. All pages are local and in the same folder. The id of the input box is 'ddutykey'. The name of the new window would be showduty.php if possible.
View 3 Replies
View Related
Oct 8, 2011
I kinda stuck at this point on my php script, it has this javascript code and I stuck there:
Line 16:
echo("<script language="JavaScript">
function openptc(tpge,pnme,w,h){
settings="width=" + w + ",height=" + h + ",scrollbars=yes,location=no,directories=no,status=1,menubar=no,toolbar=no,resizable=no";
window.open(tpge,pnme,settings);
}
//-->
</script>");
Line 72:
print "<td><a href="#" onClick="openptc('./paidtoclick.php?adid=$row[linkid]&action=start&".session_name()."=".session_id()."','PaidtoClickPage','640','480');"><b>Click Here To View</b></a><tr>";
I think those 2 lines actually are my problem. This code makes the site open in a new pop up window. how to make it open in a new tab.
View 2 Replies
View Related
Aug 18, 2010
I have a starting page, Page1.php that uses Page1.js.In Page1.js, I'm using the onclick event for a button that's on that page. When the button is clicked, it goes to Page2.php. Okay, fine.Page2.php is using Page2.js. But when the browser switches to page 2, I get a javascript error because, somehow, it's still referencing the Page1.js file. (Using IE8)So how do I 'dereference' the first javascript file, so that when Page2 loads, it doesn't still try to instantiate the objects in Page1.js? (I'm getting a null object error when Page2.php loads).
View 3 Replies
View Related
Dec 25, 2011
From a parent window, I open two child windows.In the second child, you complete some data, and then it closes the window. I'm trying to figure out how to find and close the first popup window at the same time (as that is used for reference but no action necessary on it).As near as I can tell window.open should let me set a handle that I can then reference later on to close that window (or am I misunderstanding that), but i cannot figure out how to reference that window.
View 1 Replies
View Related
Jul 23, 2005
I need some help with closing a popup window. I'm making an online portfolio,
that has one base page with text and thumbnails. When a user clicks on a thumb,
a new window opens containing a larger image and a caption (each contained on a
separate htm document). I do this with a function in the header script as follows:
var picpage=" ";
var params=" ";
function fullpicwin(picpage,params)
{
window.status="Opening picture... please wait";
window.open(picpage,'fullpic',params)
}
picpage (the name of the htm file), and params (window size, etc.) are passed
from the click code by each thumb. Each popup is sized differently, of course,
based on the side of the larger photo. All controls, etc., in the popup are
turned off. The user can click the "x" box or a form button at the bottom of
the popup to close the window.
All this works very nicely... EXCEPT...
The user can move the mouse back to the main page and open ANOTHER popup by
clicking on another thumb BEFORE closing the existing popup. The problem is the
2nd popup retains the size of the first, so of course the photo may be blocked
by the borders, etc.
What I want to do is force the closing of the first popup if the user tries to
open a 2nd and so on. There is no reason to have more than one large photo
showing at the same time.
I thought I could put some code in the function that checks for the existence
of a window named "fullpic", and if it's there, closes it first, then opens
another. But I can't seem to get the syntax right.
View 1 Replies
View Related
Feb 10, 2011
I have a lightbox pop up on my homepage. I'm curious if there's a way to automatically close the pop up after 5 seconds or so.
For some readon onClose kept popping in my head, but I'm pretty sure that's not correct.
!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
[Code]....
View 1 Replies
View Related
Aug 21, 2009
How could I open a page/popup after closing one? The objective is to log the user out if they haven't Logged out or clicked Logout.
I am sure there is a simple way to do this. None of my ideas work.
The only answer I could come with (after testing the whole day...) IE(any version), Firefox, and other browsers don't support this idea, due to the fact that the user clicked close and you can't impose things on them.
View 21 Replies
View Related
Apr 25, 2011
code to show ( overlay / modal window ) to the user when closing or navigating away from the page ( i want put in this window facebook share to make the user to share the page in his facebook ) , bytheway i wanna use it in my wordpress in every post could it be happen ?
View 1 Replies
View Related
Aug 4, 2011
when i closing popup div on firefox 3 not work well,and this my script for reload parent :
window.location.reload();
it work on firefox 4 but on firefox 3, it doesn't work well...
View 2 Replies
View Related
Apr 2, 2006
How can I trap, that on closing a parent window the child window should
also get closed.
View 1 Replies
View Related
Nov 15, 2011
I have done thus far is set up a simple Ajax request to my server to log in a user (This part seems to work just fine). The problem that I am incurring is that I would like to close the window if the user has been successfully logged in and not close the window (aka - show the form errors via php) if the user did not input the correct credentials.
This is what I have got so far (which simply logs in a user): -note: the php currently just spits out Sucess or Fail to the jquery ajax request and I would like to add a way to verify if logged in then close window but if not keep window open
$(document).ready(function(){
$("#myform").validate({
debug: false,
rules: {
[Code]....
This seems to work fine and dandy to just return Success or Fail to the #results div but is there a way to verify if the user is logged in success or not or at least a way to catch such validation that is sent back from the php script?
I was also playing with adding the below code after the $.post request but it obviously just closes the window no matter what the response.
window.close();
// return
return false;
View 3 Replies
View Related
Sep 24, 2009
I'm having trouble with Safari. After i close a popup it does not focus on the parent window. I have been looking around and i think its this sort of thing i need 'javascript:window.opener.focus()" target="_self"' but tbh i'm not in anyway a javascript whizz, so im a little confused.
Here is my current code to close the child window
document.write("<input name='close' class='button popup' type='button' value='Close Window' onclick='window.close()' id='close'>"
So i need to somehow, add in the .opener thing to that.
View 2 Replies
View Related
Jan 24, 2010
I have a parent page which I don't have control of. I call my child page from parent page, perform some operations and once I click update child window should close and parent window should be refreshed.Everything seems to work fine except the parent page not refreshing.I tried using window.opener.location.reload(true). But it makes a postback in the parent page and so the values that I update are lost because it makes a postback with the previous values.I tried window.opener.document.locationwindow.opener.document.location. But this doesn't refresh my parent page.
View 2 Replies
View Related
Jul 20, 2005
Iam using mozilla firebird. I have three popups displayed at one point of time...if I close one the other two goes hidden....could you please suggest me the reason for this behaviour and how to overcome it.....
While I opened......these child windows(popup)...from the main window
I have given "dependent=yes" in the window.open statement.
The sameway I want to close the Child windows opened from the parent
window using IE. I use IE 6.0.
View 2 Replies
View Related
Nov 29, 2005
How can I prevent the user from closing the window? I need some how to
prevent the user from closing the window even if he tried to close it
from the (X) button in the top right of the window?
View 1 Replies
View Related
Aug 22, 2006
For my web application i need to know, when the user closes the browser i need to do some activities.
View 1 Replies
View Related
Sep 5, 2004
Basically I have problem and I was wondering someone can help. I have my and on clicking a submit button i create like smaller pop up window in which i display a text area what i would like to do is that when the save button is clicked the page should be submitted back to the original page as well as the small window closing is that possible i do not want to use like a seperate close button.
View 5 Replies
View Related
Nov 5, 2006
Is there any method of calling a function when the user closes the page? (the browser or the tab).
View 2 Replies
View Related
Sep 11, 2002
Does anyone know how to have a pop-up window close once someone's clicked on a link? And can cookies be incorporated into this so that the window only pops up once a day?
At the minute, when someone clicks on a link, it opens up the page behind the window so you have to then also close the window. This is the script now: Code:
View 6 Replies
View Related
Mar 9, 2009
I am using a pop-up on my site that allows people to subscribe to my email list. Is there a way that once the visitor subscribes, the pop-up window can automatically close and the subscriber is sent to the confirmation page in a new window?
View 3 Replies
View Related
Nov 2, 2011
<script>
var rXL = "";
do
{
rXL = prompt("Enter more entries? Y/N"); // IF Y or N is entered, the loop should in theory exit
}
while (rXL != "Y" || rXL != "N");
</script>
IF Y or N is entered, the above loop should in theory exit, however it results in a infinite loop :/.
Does anyone know what I'm doing wrong?
View 1 Replies
View Related
Jul 23, 2005
Is there a way to make a javascript do something when the user closes the
browser? I would like it to go another url or something.
I do not want this script to run when a user clicks on a link on the page,
only when they close the browser.
View 3 Replies
View Related
Jul 23, 2005
I have a system whereby I'd like users to log off, however, some people
simply close the window.
Can anyone tell me how to call my 'log off' page when the main window is
closed?
View 3 Replies
View Related