homepage Welcome to WebmasterWorld Guest from 23.22.217.122
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Pubcon Platinum Sponsor 2014
Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
Forum Library, Charter, Moderator: open

JavaScript and AJAX Forum

    
DHTML popup box is NOT getting closed!
Gowri pandiyan




msg:4578067
 5:26 am on May 27, 2013 (gmt 0)

Hi,

I have been facing the below issue...

I'm displaying the DHTML popup box while clicking a link(i.e., go)....

In the script, close button is used to close the DHTML popup box....It is getting closed when I click it at very first time....but it is not getting closed in case I close the popup box and reopen the popup box by clicking the same link(i.e.,go)...Kindly, look into the below code and let me know what could be the issue here...

Note: the above problem is happening for minimize and maximize buttons as well..

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
<head>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript" src=".../popup.js"> // Kindly download it from the following link.... [dynamicdrive.com...]

</script>
<script language=javascript>


function closeWindow()
{
window.close();
}

function redirct1()
{
window.open("http://www.google.com","_blank")
}

function redirct2()
{
window.open("http://www.yahoo.com","_blank")
}

function popUpWindow() {

new popUp(200, 100, 350, 200, 'Div1', "<center><table border='0' cellpadding='15' cellspacing='0' width='300'><tr><td><p>Please select a site which you want to be redirected</p><p align='center'><button onclick='javascript:redirct1();'>Google</button>&nbsp;&nbsp;<button onclick='javascript:redirct2();'>Yahoo!</button></p><a href='javascript:closeWindow();'><font color='#ff8000'>NO</font></a>. Close this window</font></td></tr></table></center>", 'white', 'black', 'bold 10pt sans-serif', 'Site selection', 'navy', 'white', '#dddddd', 'gray', 'black', true, true, true, true, false);

}

</script>


</HEAD>

<BODY>

<a href = "#" onclick="popUpWindow();">go</a>

</BODY>
</HTML>

 

Gowri pandiyan




msg:4579363
 8:46 am on May 30, 2013 (gmt 0)

Could you please look into the above issue and let me know what could be the issue here?

Fotiman




msg:4579516
 3:41 pm on May 30, 2013 (gmt 0)

The link to the script is not available. Have you tried opening your browsers JavaScript console? Do you see errors in the console?

Gowri pandiyan




msg:4579712
 3:59 am on May 31, 2013 (gmt 0)

Thanks for your reply...Sorry for not sending the valid link....Please find the below code with valid link...One more thing, I am NOT receiving any error in the console....


<html>
<head>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript" src="http://www.cross-tab.us/geetanjali/BMI/Final/popup.js">

</script>
<script language=javascript>


function closeWindow()
{
window.close();
}

function redirct1()
{
window.open("http://www.google.com","_blank")
}

function redirct2()
{
window.open("http://www.yahoo.com","_blank")
}

function popUpWindow() {

new popUp(200, 100, 350, 200, 'Div1', "<center><table border='0' cellpadding='15' cellspacing='0' width='300'><tr><td><p>Please select a site which you want to be redirected</p><p align='center'><button onclick='javascript:redirct1();'>Google</button>&nbsp;&nbsp;<button onclick='javascript:redirct2();'>Yahoo!</button></p><a href='javascript:closeWindow();'><font color='#ff8000'>NO</font></a>. Close this window</font></td></tr></table></center>", 'white', 'black', 'bold 10pt sans-serif', 'Site selection', 'navy', 'white', '#dddddd', 'gray', 'black', true, true, true, true, false);

}

</script>


</HEAD>

<BODY>

<a href = "#" onclick="popUpWindow();">go</a>

</BODY>
</HTML>

daveVk




msg:4579726
 5:15 am on May 31, 2013 (gmt 0)

Do not know if problem but

<a href='javascript:closeWindow();'>

would be better as

<a href="#" onclick="closeWindow();" >

as you did in 'go' case

Gowri pandiyan




msg:4579729
 5:31 am on May 31, 2013 (gmt 0)

Thanks for your reply, Dave...I have changed the code as you instructed above ...But still it isn't working... :(

The problem is "minimize", "maximize" and "close" buttons are working fine while i click "go" button at very first time......If I click these buttons when i open the window after closing the popup window by using close button image...

<html>
<head>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<script language="JavaScript" src="http://www.cross-tab.us/geetanjali/BMI/Final/popup.js">

</script>
<script language=javascript>


function closeWindow()
{
window.close();
}

function redirct1()
{
window.open("http://www.google.com","_blank")
}

function redirct2()
{
window.open("http://www.yahoo.com","_blank")
}

function popUpWindow() {

new popUp(200, 100, 350, 200, 'Div1', "<center><table border='0' cellpadding='15' cellspacing='0' width='300'><tr><td><p>Please select a site which you want to be redirected</p><p align='center'><button onclick='javascript:redirct1();'>Google</button>&nbsp;&nbsp;<button onclick='javascript:redirct2();'>Yahoo!</button></p><a href='#' onclick='closeWindow();'><font color='#ff8000'>NO</font></a>. Close this window</font></td></tr></table></center>", 'white', 'black', 'bold 10pt sans-serif', 'Site selection', 'navy', 'white', '#dddddd', 'gray', 'black', true, true, true, true, false);

}

</script>


</HEAD>

<BODY>

<a href = "#" onclick="popUpWindow();">go</a>

</BODY>
</HTML>

Gowri pandiyan




msg:4579730
 5:36 am on May 31, 2013 (gmt 0)

The problem is "minimize", "maximize" and "close" buttons are working fine while i click "go" button at very first time......If I click these buttons when i open the window after closing the popup window by using close button image, all three buttons are not working properly...

Gowri pandiyan




msg:4580872
 4:11 am on Jun 4, 2013 (gmt 0)

Hi there... I'm waiting for the reply... :-)

Fotiman




msg:4581036
 1:30 pm on Jun 4, 2013 (gmt 0)

The script you're using is kind of a mess... mostly because it's ancient. Looks like it was designed for IE4/NS4/NS6 days. Honestly... it's such a mess, I wouldn't use it... I would throw it out and start from scratch. Sorry, I wish I could be more helpful, but it's just such a mess.

Gowri pandiyan




msg:4581538
 4:02 am on Jun 6, 2013 (gmt 0)

Thanks for the reply! :-) I have rectified the issue...It is working fine after I removed cookies in the script..

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / JavaScript and AJAX
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved