Welcome to WebmasterWorld Guest from 54.161.110.186

Forum Moderators: open

Message Too Old, No Replies

DHTML popup box is NOT getting closed!

     
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>
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?
3:41 pm on May 30, 2013 (gmt 0)

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



The link to the script is not available. Have you tried opening your browsers JavaScript console? Do you see errors in the console?
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>
5:15 am on May 31, 2013 (gmt 0)

WebmasterWorld Senior Member 5+ Year Member



Do not know if problem but

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

would be better as

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

as you did in 'go' case
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>
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...
4:11 am on Jun 4, 2013 (gmt 0)



Hi there... I'm waiting for the reply... :-)
1:30 pm on Jun 4, 2013 (gmt 0)

WebmasterWorld Senior Member fotiman is a WebmasterWorld Top Contributor of All Time 5+ Year Member Top Contributors Of The Month



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.
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..
 

Featured Threads

Hot Threads This Week

Hot Threads This Month