Click here to Skip to main content
15,906,081 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a page on which two links are there.On click of first link one jquery window is opened and on click of second link one htmlpopup window(dhtml window) is opened.
But when I open first link (i.e jquery window) and after opening closing that window and after that i am opening second link.. after clicking on second link i have got the following error..

Window master is already registered in the DOM! Make sure you use setDestroyOnClose() or destroyOnClose: true in the constructor


please help..
Posted
Comments
Please post your codes.
PrachiMhatre 1-Aug-12 8:46am    
I have this two links
<a href="#" id="aViewPolicy" runat="server" causesValidation="false">View Policy Copy
View Insured/Insurer Details    

on the second link following javascript function is called

function win(link) {
if (link == 'PH') {
var win = new Window("master", { className: "alphacube", title: "Policy Insured Details", showEffect: Element.show, hideEffect: Element.hide,
width: 830, height: 300, maximizable: true, minimizable: true,
closable: true, url: "../Enrollment/InsuredDetailPopUp.aspx?PolicyType=" + document.getElementById("hiddenPolicyType").value + "&DHSID=" + document.getElementById("hiddenDHSID").value + "&PolicyIdNo=" + document.getElementById("hiddenPolicySetupIdNo").value
})
}

win.setDestroyOnClose();
win.show();
}

for executing the above script I have included the following js files

<script type="text/javascript" src="../Script_Library/prototype.js"> </script>
<script type="text/javascript" src="../Script_Library/effects.js"> </script>
<script type="text/javascript" src="../Script_Library/window.js"> </script>
<script type="text/javascript" src="../Script_Library/debug.js"> </script>




On first link aViewPolicy following code is there

on this page one control is added like this
<div id="divDocumentViewer" runat="server" visible="false" style="z-index:6;">
<sdv:DocumentViewer ID="documentViewer" runat="server" />
</div>

and on that control following code is there

<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="ScannedDocumentViewer.ascx.vb" Inherits="DHS.ScannedDocumentViewer" %>
<link href="../App_Themes/New/byrei-dyndiv_0.5.css" rel="stylesheet" type="text/css" />
<link rel="stylesheet" href="../App_Themes/New/Zoomer.css" type="text/css" />
<script src="../Script_Library/byrei-dyndiv_1.0rc1.js" type="text/javascript"></script>
<script type="text/javascript" src="../Scripts/jquery-1.3.2.js"></script>
<script type="text/javascript" src="../Scripts/jquery.history.js"></script>
<script type="text/javascript" src="../Scripts/jquery.galleriffic.js"></script>
<script type="text/javascript" src="../Scripts/jquery.opacityrollover.js"></script>
<style type="text/css">
#testdiv_2 {
width: 900px;
height: 300px;
left: 10px;
top: 10px;
border: 3px solid #465c71;
position: absolute;
padding-bottom:-200px;
}
#testdiv_2_move {
text-align: center;
opacity:0.5;
color: #fff;
}
</style>
<input type="hidden" runat="server" id="hiddenDocumentViewFlag" name="hiddenDocumentViewFlag"/>
<input type="hidden" runat="server" id="hiddenControlInwardId" name="hiddenControlInwardId"/>
<div id="testdiv_2" style="background-color:#fff;">
<table style="border: 1px solid #465c71; background-color:#fff;" width="100%">
<tr>
<td valign="top">
<div style="width: 175px; padding-left: 5px; padding-top: 20px; height: 26px; background-image: url(../images/banner-blue.gif);
background-repeat: repeat; background-position: left top;">
<img alt="Zoom In" title="Zoom In" src="../images/zoomin.gif" önclick="izImgZoom_zoomIn();"
style="margin: 6px 3px 4px 3px; width: 16px; height: 16px; border: none; cursor: pointer;" />
<img alt="Zoom Out" title="Zoom Out" src="../images/zoomout.gif" önclick="izImgZoom_zoomOut();"
style="margin: 6px 3px 4px 3px; width: 16px; height: 16px; border: none; cursor: pointer;" />
<img alt="Actual Size" title="Actual Size" src="../images/actualsize.gif" önclick="izImgZoom_actualSiz

1 solution

As you've not posted code, it's hard to say what's going on, but obviously both methods do the same thing, and they are running in to one another. You need to fix your code to solve this issue. You can use Chrome to debug javascript, examine the state of objects, etc. That should help you work out what your error is. If you're still stuck, we can't fix your code if you don't show it to us.

The 'win' object is clearly the issue. You must be creating it again somewhere else, or just creating it when it's already created when this method is called twice.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900