• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Ron McLeod
  • Junilu Lacar
  • Liutauras Vilda
Sheriffs:
  • Paul Clapham
  • Jeanne Boyarsky
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Piet Souris
  • Carey Brown
Bartenders:
  • Jesse Duncan
  • Frits Walraven
  • Mikalai Zaikin

onbefore unload

 
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
By Clicking on an image I am opening one jsp as a seperate window(popup1). When I close this popup window by clicking on window CLOSE button, one more window should open i.e., popup2. In this case popup window should not close.

for that I am using follwing code, but its not working...

<HTML>
<HEAD>

</HEAD>

<body onLoad="check(false);" onUnLoad="check(true);">


<table width="100%" height="100%" border="0" cellpadding="0" cellspacing="0" bgcolor="#A3D1FF" >
<form method="post" name="theForm">

<tr>
<td colspan=3 width="100%" height="30" align='<%=leftAlign%>'><span class="darkbluefont13"><strong>   </strong></span></td>
</tr>

<tr>
<td width="10%"> </td>

<% String s = "siebelcrm/EBI/"+campId+"/offer.html";%>
<td width="60%" align="center" style="padding:0px 0px 0px 12px"><jsp:include page="<%=s%>"/> </td>
</tr></table></td>
<td width="10%"> </td>

</tr>
<tr height="10%"><td colspan=3 width="100%" height="30" align='center'><span class="darkbluefont13"><strong>   </strong></span></td></tr>
<tr>
<td width="2%" align='center'> </td>
<td align="center">
<table border="0"><tr>
<td>
<a href="#" onclick="check(false);"><img src="apply.gif" alt="banner" border="0"></a>   
<a href="#" onclick="check(false);"></a>   
</td>
</tr></table></td>
</tr>
<tr>
<td colspan=3 width="100%" height="30" align='<%=leftAlign%>'><span class="darkbluefont13"><strong>   </strong></span></td>
</tr>


</form>
</table>

<%
}

%>


<script type="text/javascript" language="JavaScript">
var flag;
function check(f){

flag=f;

}
if(flag){
window.onbeforeunload = confirmExit;
}

function confirmExit()
{

child2=
window.open('enbdCampaignOffer2.jsp?campaignid=<%=campId%>&targetid=<%=targetId%>&contid=<%=contactId%>&treatid=<%=treatId%>','call','dependent=no,directories=no,location=no,menubar=no,status=no,titlebar=no,toolbar=no,scrollbars=yes,resizable=yes,hotkeys=no,width=500,height=110');

return child2;
}

</script>
</body>
</html>


Please suggest me correct approch to meet my requirement.

Thanks in advance.
 
sandhya sri
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
screenshot
popupscrnshot.png
[Thumbnail for popupscrnshot.png]
 
sandhya sri
Greenhorn
Posts: 16
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
pfa

<html>
<head>
<SCRIPT type="text/javascript" src="js/jquery-1.4.2.min.js"></SCRIPT>
<SCRIPT type="text/javascript" src="js/jquery.blockUI.js"></SCRIPT>
<script type="text/javascript">


var LOADINGIMAGE = 'HELLO WORLD';
function callblock(){
var el = document.createElement("iframe");
el.setAttribute('id', 'blockUIiframe');
el.height = "100%";
el.width = "100%";
el.scrolling = "yes";
if(document.getElementById("showBlockUI")!=null){
document.getElementById("showBlockUI").appendChild(el);
el.setAttribute('src', "file:///C://Users/Shirisha/Desktop/sample_abc/sample/popup.html");


$.blockUI({message: $('#blockUIiframe')});
}
}

</script>

</head>
<body>
<div id="showBlockUI_Parent" height="100%">
<div id="showBlockUI"></div>
</div>

<img src="Nice.jpg" onclick="javascript:callblock()"/>

</body>
</html>

popup
-------
<html>
<head>
<style type="text/css">
#tutors-popup {
position: fixed;
top: 0;
right: 0;
}
</style>
<script type="text/javascript">
function openPopup()
{

myWindow=window.open('','','width=800,height=600')
myWindow.document.write("<html><head></head><body>promt user and close</body></html>")
myWindow.focus();
}
</script>
</head>
<body >
<div id="tutors-popup">
<img alight="right" src="close_button.png" id="fullPic" onclick="openPopup();"/>
</div>

<div>test pop up page 1 </div>




</body>
</html>

 
Sheriff
Posts: 67645
173
Mac Mac OS X IntelliJ IDE jQuery TypeScript Java iOS
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
pfa?

And did you read the link I posted?
 
reply
    Bookmark Topic Watch Topic
  • New Topic