By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,516 Members | 1,178 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,516 IT Pros & Developers. It's quick & easy.

window.onunload does not work in IE6

P: 27
hi all,

i am using window.onunload() method in IE6, it works fines in local, but it does not work in Integration Box(Linux Environment), i have written a simple alert() statement to check whether it does really trigger that event alert() statement is also not working it seems event it self is not triggering. But it works fine in IE7 and FireFox.

here is my code snippet:
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. window.onunload = confirmExit;
  3.  
  4. function confirmExit(){
  5.             if( !flag ){
  6.                 window.opener.location.href = "<%= request.getContextPath() %>"+"/postHome.do";
  7.             }
  8.         }
  9. </script>
  10.  
what should i need to do in order to work.
do we need to set any extra attributes :(
Any help deeply appreciated,

its very urgent.


thanks,
Rakesh.
Nov 20 '07 #1
Share this Question
Share on Google+
13 Replies


acoder
Expert Mod 15k+
P: 16,027
onunload should work in IE6 as far as I'm aware.

Where do set the flag variable?

Have you tried onbeforeunload instead?
Nov 20 '07 #2

P: 27
onunload should work in IE6 as far as I'm aware.

Where do set the flag variable?

Have you tried onbeforeunload instead?
Thanks for Quick Reply

i am using flash content in my jsp onbeforeunload is getting fired when my flash is loading why i havent understood that.

how can i use onunload, what are the possible causes for getting not executed.

urgent :(

thanks,
rakesh.
Nov 21 '07 #3

acoder
Expert Mod 15k+
P: 16,027
Post the onbeforeunload code.
Nov 21 '07 #4

P: 27
Post the onbeforeunload code.
i have used the same code for onbeforeunload which i have used for onunload
Nov 21 '07 #5

acoder
Expert Mod 15k+
P: 16,027
Check that window.opener still refers to the parent.

Also, is the value of flag false?
Nov 21 '07 #6

P: 27
Check that window.opener still refers to the parent.

Also, is the value of flag false?

var flag = false;

Yes the Value of Flag is set to false initially and based on condition we are setting that as true.

Even when i kept simple alert statement it is not working.
I suppose the event is not getting triggered.

pls suggest.

thanks,
Rakesh.
Nov 26 '07 #7

acoder
Expert Mod 15k+
P: 16,027
Does this example work in IE6?
Nov 26 '07 #8

P: 27
Does this example work in IE6?

Since it is a straight forward example it is working fine.. in IE6, in local for me it is working but when it goes to Linux Environment it is failing.

My Script is placed in Head tags only... does it have any effect... where we need to define such kind of scripts....

i repeat it is not at all calling onunload function also...
since i have tested it by keeping simple alert statement in it, but it is not working for me.

Any Suggestion greatly appreciated.

Rakesh
Nov 26 '07 #9

acoder
Expert Mod 15k+
P: 16,027
So even the W3Schools example is not working?

You have IE6 on Linux?!
Nov 26 '07 #10

P: 27
So even the W3Schools example is not working?

You have IE6 on Linux?!
Ya, we have our application deployed there and we are accessing that from our system.


Rakesh
Nov 26 '07 #11

acoder
Expert Mod 15k+
P: 16,027
Can you post the whole page code to test?
Nov 26 '07 #12

P: 27
Can you post the whole page code to test?
please find the code which i am using.

[HTML]<%@ taglib uri="/WEB-INF/struts-html.tld" prefix="html" %>
<%@ taglib uri="/WEB-INF/struts-bean.tld" prefix="bean" %>
<%@ taglib uri="/WEB-INF/struts-logic.tld" prefix="logic" %>
<%@ taglib uri="/WEB-INF/struts-tiles.tld" prefix="tiles" %>
<%@ taglib uri="/WEB-INF/app.tld" prefix="app" %>

<%@ page import="com.gtech.esi.core.system.util.GlobalAppli cationObject" %>
<%@ page import="com.gtech.esi.core.system.Global" %>
<%@ page import="com.gtech.esi.core.system.notification.Not ification" %>
<%@ page import="com.gtech.esi.core.gui.player.game.instant .form.ShowGameDetailForm" %>
<%@ page import="com.gtech.esi.core.gui.player.uam.PlayerBe an" %>
<%@ page import="org.apache.struts.Globals" %>
<%@ page import="java.text.NumberFormat"%>
<%@ page import="java.util.Locale"%>

<%@ page import="java.text.DecimalFormat"%>
<%@ page import="java.text.DecimalFormatSymbols" %>

<head>
<title>LOTERIE NATIONALE LUXEMBOURG</title>
<link rel = "stylesheet" href = "<%= request.getContextPath() %>/lottery/CSS/general.css" type = "text/css">
<link rel = "stylesheet" href = "<%= request.getContextPath() %>/lottery/CSS/loterie.css" type = "text/css">
<link rel = "stylesheet" href = "<%= request.getContextPath() %>/lottery/CSS/rubbel.css" type = "text/css">
<link rel = "stylesheet" href = "<%= request.getContextPath() %>/lottery/CSS/interactive.css" type = "text/css">
<link rel = "stylesheet" href = "<%= request.getContextPath() %>/styles/style.css" type = "text/css">
<script type = "text/javascript" src = "<%= request.getContextPath() %>/lottery/js/menu.js"></script>
<script type = "text/javascript" src = "<%= request.getContextPath() %>/lottery/js/tools.js"></script>
<script type = "text/javascript" src = "<%= request.getContextPath() %>/lottery/js/xml.js"></script>
<script src="<%= request.getContextPath() %>/lottery/js/AC_RunActiveContent.js" type="text/javascript"></script>
<script src="<%= request.getContextPath() %>/lottery/js/AC_ActiveX.js" type="text/javascript"></script>

[/HTML]
Expand|Select|Wrap|Line Numbers
  1.         <script type="text/javascript">
  2.             //nsingh Added for capturing cross browser backspace button
  3.     document.onkeydown = function(e) {handleKeys(e)}
  4.     document.onkeypress = function(e) {handleKeys(e)}
  5.     function handleKeys(e) { 
  6.         if(e)        
  7.         {
  8.         if (e.stopPropagation) {
  9.             e.stopPropagation();
  10.             e.preventDefault();
  11.             }
  12.         } else{
  13.     window.event.cancelBubble = true;       //IE reports window.event not arg 
  14.     window.event.returnValue = false;       //IE reports window.event not arg 
  15.  
  16.         }
  17.     }
  18.             if (document.images)
  19.                 {
  20.                     img1 = new Image();
  21.                     img2 = new Image();
  22.                     img3 = new Image();
  23.                     img4 = new Image();
  24.                     img5 = new Image();
  25.                     img1.src = "<%= request.getContextPath() %>/images/logo.gif";
  26.                     img2.src = "<%= request.getContextPath() %>/images/btn_select_demo.gif" ;
  27.                     img3.src = "<%= request.getContextPath() %>/images/btn_autrex_jue.gif" ;
  28.                     img4.src = "<%= request.getContextPath() %>/images/btn_transfer.gif" ;
  29.                     img5.src = "<%= request.getContextPath() %>/images/white_point.gif" ;
  30.                 }
  31.         </script>
  32.  

[HTML]<meta http-equiv="pragma" content="no-cache">
<meta http-equiv = "Expires" content = "-1">

<style>
.bgcol{background-color: #6DB344;}

li.submenu {
background-color:#6DB344;
background-image:none;
text-align:left;
line-height:20px;
border-top-width:1px;
}
ul.submenu {
background-color:#6DB344;
background-image:none;
text-align:left;
line-height:20px;
border-top-width:1px;
}
</style>

<script>
[/HTML]
Expand|Select|Wrap|Line Numbers
  1.     if (navigator.userAgent.indexOf("MSIE") >= 0)
  2.         {
  3.             document.writeln("<style> .menulist li.cat { border-top: 1px solid #3f7437; } </style>");
  4.         }else if (navigator.userAgent.indexOf("Firefox") >= 0)
  5.         {
  6.             document.writeln("<style> .menulist li.cat { border:1px solid #3f7437; border-left-width: 0px;} </style>");
  7.             document.writeln("<style> #dropdown li.cat { border-top:1px solid #3f7437;} </style>");
  8.         }
  9.         else{
  10.             document.writeln("<style> .menulist li.cat { border-top: 1px solid #3f7437; } </style>");                
  11.         }
  12. </script>
  13.  
  14. <script>
  15.     if (navigator.userAgent.indexOf("MSIE") >= 0)
  16.         {
  17.             document.writeln("<style> .fontprice { float:right;    } </style>");
  18.         }else if (navigator.userAgent.indexOf("Firefox") >= 0)
  19.         {
  20.             document.writeln("<style> .fontprice { margin-top:-20px; } </style>");
  21.         }
  22.         else{
  23.             document.writeln("<style> .fontprice { margin-top:-20px; } </style>");                
  24.         }
  25. </script>
  26.  
  27. <script>
  28.     if (navigator.userAgent.indexOf("MSIE") >= 0)
  29.         {
  30.             document.writeln("<style> .gameStyle { float:left; } </style>");
  31.         }else if (navigator.userAgent.indexOf("Firefox") >= 0)
  32.         {
  33.             document.writeln("<style> .gameStyle { margin-left:0px; } </style>");
  34.         }else if (navigator.userAgent.indexOf("Opera") >= 0)
  35.         {
  36.             document.writeln("<style> .gameStyle { margin-left:-50px; } </style>");
  37.         }
  38.         else{
  39.             document.writeln("<style> .gameStyle { margin-left:-70px; } </style>");                
  40.         }
  41. </script>
  42.  
  43. <script type="text/javascript" >
  44.  
  45. function displayTicketNumber(ticketNumber){
  46.     if(ticketNumber){
  47.         document.getElementById("ticketNumberId").innerHTML = ticketNumber;
  48.         document.getElementById("ticketNumberId").style.visibility="visible";
  49.     }
  50. }
  51.  
  52. function doNotDisplayTktNumber(){
  53.   if( document.getElementById("ticketNumberId")){
  54.     document.getElementById("ticketNumberId").style.visibility="hidden";
  55.     }
  56. }
  57.  
  58. function displayWalletBalance(ticketNumber,walletBalance){
  59.     if( document.getElementById("walletBalanceId") ){
  60.         document.getElementById("walletBalanceId").innerHTML = walletBalance;
  61.         document.getElementById("walletBalanceId").style.visibility="visible";
  62.         document.getElementById("walletBalanceId").style.width="";
  63.         document.getElementById("walletBalanceId").style.height="";
  64.     }
  65.     window.opener.parent.globalPopupCtr = new Date().getTime();
  66.     if( document.getElementById("ticketNumberId") ){
  67.         document.getElementById("ticketNumberId").innerHTML = '<bean:message key="PlayGame.playInstGame.ticketNumber"/>'+'<b>'+ticketNumber+'</b>';
  68.         document.getElementById("ticketNumberId").style.visibility="visible";
  69.     }
  70. }
  71.  
  72. function hideAll() {
  73.     if( document.getElementById("walletBalanceId") )
  74.         document.getElementById("walletBalanceId").style.visibility="hidden";
  75.     if( document.getElementById("transferFunds") )
  76.         document.getElementById("transferFunds").style.visibility = 'hidden';
  77.     if( document.getElementById("walletBalance") )
  78.         document.getElementById("walletBalance").style.visibility = 'hidden';
  79.     if( document.getElementById("reglementOfficiel") )
  80.         document.getElementById("reglementOfficiel").style.visibility = 'hidden';
  81.     if( document.getElementById("dropDownId") )
  82.         document.getElementById("dropDownId").style.visibility = 'hidden';
  83. }
  84.  
  85. function showAll() {
  86.  
  87.     if( document.getElementById("walletBalanceId") )
  88.         document.getElementById("walletBalanceId").style.visibility="visible";
  89.     if( document.getElementById("transferFunds") )
  90.         document.getElementById("transferFunds").style.visibility = 'visible';
  91.     if( document.getElementById("walletBalance") )
  92.         document.getElementById("walletBalance").style.visibility = 'visible';
  93.     if( document.getElementById("reglementOfficiel") )
  94.         document.getElementById("reglementOfficiel").style.visibility = 'visible';
  95.     if( document.getElementById("dropDownId") )
  96.         document.getElementById("dropDownId").style.visibility = 'visible';
  97.  
  98.      listMenu.activateMenu("listMenuRoot", arrow);
  99.  
  100. }
  101.  
  102. //Added by nsingh
  103.  
  104.         var flag = false;
  105.  
  106.         document.oncontextmenu=new Function("return false");
  107.  
  108.         function rightClick(e) {
  109.             if (navigator.appName == 'Netscape' && (e.which == 3 || e.which == 2))
  110.                 return false;
  111.             else if (navigator.appName == 'Microsoft Internet Explorer' && 
  112.                         (event.button == 2 || event.button == 3)) 
  113.             {
  114.                 return false;
  115.             }
  116.             return true;
  117.         }
  118.  
  119.         document.onmousedown=rightClick;
  120.         document.onmouseup=rightClick;
  121.  
  122.         if (document.layers) window.captureEvents(Event.MOUSEDOWN);
  123.         if (document.layers) window.captureEvents(Event.MOUSEUP);
  124.  
  125.         window.onmousedown=rightClick;
  126.         window.onmouseup=rightClick;
  127.         window.onunload = confirmExit;
  128.         //document.onmousedown = shiftEnter;
  129.  
  130.  
  131.  
  132.         function shiftEnter(e) {
  133.             if (event.shiftKey) {
  134.               var msg = "<bean:message key='home.player.operationNotAllowed' />";
  135.               alert(msg);
  136.               return false;
  137.             }
  138.         }
  139.  
  140.         function setValue(){
  141.             flag = true;
  142.         }
  143.  
  144.     function confirmExit(){
  145.             <% 
  146.             if(null!=request.getParameter( "type" )    )
  147.             if(request.getParameter( "type" ).equals("wager")) { %>
  148.                 if( !flag ){
  149.                 window.opener.location.href = "<%= request.getContextPath() %>"+"/postHome.do";
  150.             }
  151.             <%}%>
  152.         }    
  153. //Added by nsingh
  154.  
  155. function activateFlash(obj){
  156.     objects = document.getElementsByTagName(obj);
  157.     for (var i = 0; i < objects.length; i++){
  158.         objects[i].outerHTML = objects[i].outerHTML;
  159.     }
  160. }
  161.  
  162. </script>
  163.  
  164. <script type="text/javascript">
  165.     function ShowMenu() {
  166.         if (document.getElementById('frame1'))
  167.         document.getElementById("frame1").style.display = "inline"; 
  168.     }
  169.     function HideMenu() {
  170.         if (document.getElementById('frame1'))
  171.         document.getElementById("frame1").style.display = "none"; 
  172.     }
  173.     function ShowMenu2() {
  174.             if (document.getElementById('frame2'))
  175.             document.getElementById("frame2").style.display = "inline"; 
  176.         }
  177.     function HideMenu2() {
  178.             if (document.getElementById('frame2'))
  179.             document.getElementById("frame2").style.display = "none"; 
  180.     }
  181. </script>
Expand|Select|Wrap|Line Numbers
  1. <script>
  2. function childWindowClose(contextPath){
  3.     //alert("window.opener.location :" + window.opener.location);
  4.     flag = true;
  5.     window.opener.location.href = contextPath+"/gaming/viewGameLobby.do?mode=display";
  6.     self.close();
  7. }
  8.  
  9. function childWindowCloseFree(){
  10.     flag = true;
  11.     self.close();
  12. }
  13.  
  14. function forwardToAddFunds(url){
  15.     if( self.opener ){
  16.         flag = true;
  17.         self.window.close();
  18.         window.opener.location.href = url;
  19.     } 
  20. }
  21.  
  22.  
  23. function showReglement(url){
  24.     window.open(url);
  25. }
  26.  
  27. function openFlash(){
  28.     if(self.opener){
  29.         flag = true;
  30.         window.open('http://www.adobe.com','newWindow','target=blank,addressbar=yes,menubar=yes,status=yes,scrollbars=yes,resizable=yes');
  31.         parent.window.close();
  32.     }
  33. }
  34.  
[HTML]</script>
</head>


<body id="play">
<bean:define id="currentBalance" name="purchaseInstGameForm" type="java.lang.String" property="walletBalance"/>[/HTML]
Expand|Select|Wrap|Line Numbers
  1. <%
  2.       Locale myLocale = new Locale(GlobalApplicationObject.getInstance().getSetting(Global.SETTING_SYSTEM_LOCALE_LANG),
  3.    GlobalApplicationObject.getInstance().getSetting(Global.SETTING_SYSTEM_LOCALE_COUNTRY));
  4.    NumberFormat numberFormatter = NumberFormat.getCurrencyInstance(myLocale);
  5.  
  6.    DecimalFormatSymbols dSymbols = new DecimalFormatSymbols(myLocale);
  7.    dSymbols.setGroupingSeparator('.');
  8.  
  9.    ((DecimalFormat)numberFormatter).setDecimalFormatSymbols(dSymbols);
  10. %>
  11. <jsp:useBean id="purchaseInstGameForm" scope="request" class="com.gtech.esi.core.gui.player.game.instant.form.PurchaseInstantForm" />
  12. <%
  13. //This is needed since the page is refreshing and hence the way the url getData url is going to get constructed again
  14.     String genericLoader = request.getContextPath() + "/movies/generic.loader.swf?";
  15.     String gamePrefix = purchaseInstGameForm.getGamePrefix();
  16.     String gameId = request.getParameter( "gameId" );
  17.     String flashVer = request.getParameter( "flashVersion" );
  18.     String gameType = request.getParameter( "type" );
  19.     String mode = request.getParameter( "mode" );
  20.     String gameTimeout = GlobalApplicationObject.getInstance().getSetting( Global.SETTING_PLAYER_SESSIONTIME );
  21.     String recoverDataSource = "recover_datasource=NIL";
  22.     String purchaseDataSource = "purchase_datasource=/player/gaming/wager/purchaseInstGame.do?gameId="+gameId+"&type="+gameType+"&mode=process";
  23.     String endGameDataSource = "endgame_datasource=/player/gaming/endGameExitPressed.do?gameId="+gameId+"&type="+gameType+"&mode=process";
  24.  
  25.     if( request.getAttribute("recover") != null && ((String)request.getAttribute("recover")).equals("true"))
  26.         {
  27.         recoverDataSource = "recover_datasource=/player/gaming/wager/purchaseInstGame.do?gameId="+gameId+"&type="+gameType+"&recover_mode=recover";
  28.         request.removeAttribute("recover");
  29.         }
  30.  
  31.     String urlParams = "flashGame=" + request.getContextPath() + "/movies/" + gamePrefix + "/"
  32.         + "&gameID=" + gameId
  33.         + "&flashVersion=" + flashVer
  34.         + "&type=" + gameType
  35.         + "&sess_to=" + gameTimeout
  36.         + "&ticketID=" + "TEST"
  37.         + "&gameProvider=" + "TEST"
  38.         + "&gamePrefix=" + gamePrefix
  39.         + "&played="
  40.         + "&"
  41.         + purchaseDataSource 
  42.         +"&"
  43.         + recoverDataSource 
  44.         +"&"
  45.         + endGameDataSource;
  46.  
  47.  
  48.  
  49.     String urlPlayPart = genericLoader + urlParams;// commented this since it is included in urlparams.+ purchaseDataSource;
  50.  
  51. %>
  52.  
  53. <%
  54.     String errorCode = (String) request.getAttribute(Global.GAME_ERROR_KEY);
  55.     if(errorCode !=null && errorCode.equals(Global.ERROR_INSUFFICIENT_FLASH)){
  56.  
  57. %>
  58. <table>
  59.     <tr>
  60.         <td>
  61.             <bean:message key="PlayInstGame.FlashError.errorCopy1"/>&nbsp;
  62.             <a href="#" onclick='javascript:openFlash();'><bean:message key="PlayInstGame.FlashError.errorCopy3"/></a>
  63.             &nbsp;<bean:message key="PlayInstGame.FlashError.errorCopy2"/>
  64.         </td>
  65.     </tr>
  66. </table>
  67. <%    
  68. }else{
  69. %>
  70.  
  71. <script>
  72.     if (navigator.userAgent.indexOf("MSIE") >= 0)
  73.     {
  74.         document.writeln("<table align='center' border='0' style='margin-left:-6px;margin-top:-5px'>");
  75.     }else if(navigator.userAgent.indexOf("Firefox") >= 0)
  76.     {
  77.         document.writeln("<table align='center' style='margin-left:4px;'>");
  78.     }
  79. </script>
  80.  
  81.  
  82.                 <tr>
  83.                     <td>
  84.                         <img src="<%=request.getContextPath()%>/images/logo.gif" style="position:absolute;top:5px; margin-top:0px;">
  85.                     </td>
  86.                     <% if( gameType.equals("free") ) {%>
  87.                     <td style="position:absolute; top:5px; left:420px" >
  88.                         <object type="application/x-shockwave-flash" data="<%=request.getContextPath()%>/lottery/fr/flash/demo.swf" style="margin-bottom: 5px; position: relative; top: -3px; left: -160px;" height="38" width="300" onload="activateFlash(this)">
  89.                             <param name="movie" value="<%=request.getContextPath()%>/lottery/fr/flash/demo.swf">
  90.                         </object>
  91.                     </td> 
  92.                     <% } %>
  93.                     <% if( !gameType.equals("free") ) {
  94.                             PlayerBean playerBean = (PlayerBean) request.getSession().getAttribute(
  95.                 Global.SESSION_PLAYER_DATA);
  96.                             if(playerBean.getPaymentcardAccount() != null){
  97.                     %>
  98.                     <td align="right" id="transferFunds" style="position:absolute; top:5px; left:440px; visibility:hidden;" ><a href="javascript:#"><img onclick="forwardToAddFunds('/player/account/wallet/landing.do?action=add');return false;" src="<%= request.getContextPath() %>/images/btn_transfer.gif" border="0" alt="" align="absmiddle"></a></td> 
  99.                 <%} else {
  100.                         %>
  101.  
[HTML] <td align="right" id="transferFunds" style="position:absolute; top:5px; left:440px; visibility:hidden;" ><a href="javascript:#"><img onclick="forwardToAddFunds('/player/account/wallet/landing.do?action=changeDebitCard');return false;" src="<%= request.getContextPath() %>/images/btn_transfer.gif" border="0" alt="" align="absmiddle"></a></td>
<% }} %>

<td id="dropDownId" style="visibility:hidden;">
[/HTML]
Expand|Select|Wrap|Line Numbers
  1.                 <%
  2.                     String leftWidth = "220px";
  3.                     if(!gameType.equals("free")){
  4.                         leftWidth = "220px";
  5.                     } else if( gameType.equals("free") ){
  6.                         leftWidth = "600px";
  7.                     }
  8.                 %>
  9.  
[HTML] <ul class="menulist" id="listMenuRoot" style="position:absolute; top:5px; left:<%=leftWidth%>; margin:0px; padding:0px;">
<li>
[/HTML]
Expand|Select|Wrap|Line Numbers
  1.                 <% if( gameType.equals("free") ) {%>
  2.                     <a href="javascript:#"><img src="<%= request.getContextPath() %>/images/btn_select_demo.gif" border="0" alt="" width="200" align="absmiddle"></a>
  3.                 <% } else {%>
  4.                     <a href="javascript:#"><img src="<%= request.getContextPath() %>/images/btn_autrex_jue.gif" border="0" alt="" align="absmiddle"></a>
  5.                 <% } %>
  6.  
[HTML] <ul class="sub" id="dropdown">
<li class="cat" style="width:195px">&nbsp;</li>

<logic:notEmpty name="purchaseInstGameForm" property="allInstGames">
<logic:iterate id="instGames" name="purchaseInstGameForm" property="allInstGames" type="com.gtech.esi.ire.core.player.game.area.valu e.GameAttributesVO">
<li class="cat" style="width:195px">

<% if( gameType.equals("free") ) { %>
<script>[/html]
Expand|Select|Wrap|Line Numbers
  1.                                         if (navigator.userAgent.indexOf("MSIE") >= 0){
  2.                                             //alert("IE");
  3.                                             document.writeln("<span style='position:absolute; left:0px; clear:left; float:left'>");
  4.                                         }else if(navigator.userAgent.indexOf("Firefox") >= 0){
  5.                                             //alert("FF");
  6.                                             document.writeln("<span style='position:relative;left:0px; clear:left;'>");
  7.                                         }
  8.  
[HTML] </script>
&nbsp;&nbsp;

<img src="<%=request.getContextPath()%>/images/white_point.gif" style="vertical-align:middle ">&nbsp;&nbsp;
<a href="<%=request.getContextPath()%>/gaming/wager/purchaseInstGame.do?mode=display&type=<%=gameType% >&gameId=<bean:write name='instGames' property='gameId'/>&flashVersion=" class="fontdrop" onclick="setValue()"><bean:write name="instGames" property="gameName"/>
</a>
</span>
<script>
if (navigator.userAgent.indexOf("MSIE") >= 0){
document.writeln("<span class='fontprice'>");
}else if(navigator.userAgent.indexOf("Firefox") >= 0){
document.writeln("<span class='fontprice' style='float:right;'>");
}
</script>
<bean:write name="instGames" property="gameCost"/> &euro;&nbsp;</span>
<% } else { %>

<script>
if (navigator.userAgent.indexOf("MSIE 6") >= 0){
//alert("IE");
document.writeln("<span style='position:absolute; left:0px; clear:left; float:left;'>");
} else if(navigator.userAgent.indexOf("MSIE 7") >= 0){
document.writeln("<span style='position:absolute; left:0px; clear:left; float:left;'>");
} else if(navigator.userAgent.indexOf("Firefox") >= 0){
//alert("FF");
document.writeln("<span style='position:relative;left:0px; clear:left;'>");
}
</script>
&nbsp;&nbsp;

<img src="<%=request.getContextPath()%>/images/white_point.gif" style="vertical-align:middle ">&nbsp;&nbsp;
<a href="<%=request.getContextPath()%>/gaming/wager/purchaseInstGame.do?mode=display&type=<%=gameType% >&gameId=<bean:write name='instGames' property='gameId'/>&flashVersion=" class="fontdrop" onclick="setValue()"><bean:write name="instGames" property="gameName"/>
</a>
</span>
<script>
if (navigator.userAgent.indexOf("MSIE 6") >= 0){
document.writeln("<span class='fontprice'>");
} else if(navigator.userAgent.indexOf("MSIE 7") >= 0){
document.writeln("<span class='fontprice'>");
} else if(navigator.userAgent.indexOf("Firefox") >= 0){
document.writeln("<span class='fontprice' style='float:right;'>");
}
</script>
<bean:write name="instGames" property="gameCost"/> &euro;&nbsp;</span>
<% } %>
</li>

</logic:iterate>
</logic:notEmpty>

</ul>

</li>
</ul>

</td>
[/HTML]
Expand|Select|Wrap|Line Numbers
  1.                 <% if( !gameType.equals("free") ) {%>
  2.                     <td align="right" id="walletBalance" style="position:absolute; top:20px; left:660px; visibility:hidden;"><bean:message key="PlayGame.playInstGame.walletBalance"/><span style="font:bold; left:620px;" id="walletBalanceId"></span> </td>
  3.                 <% } %>
  4.  
[HTML] </tr>
<script>displayWalletBalance('','<%=currentBalance %>'); </script>
<tr><td><img src="<%=request.getContextPath()%>/lottery/img/pixel.gif" width="1" height="30" border="0" alt=""></td></tr>
<tr class = 'bgcol' >

<td valign="center" colspan = "4">
<%

String error = (String) request.getAttribute(Global.GAME_ERROR_KEY);

if(null != error && error.equalsIgnoreCase(Global.ERROR_INSUFFICIENT_F LASH)){
request.setAttribute(Global.GAME_ERROR_KEY, Global.ERROR_INSUFFICIENT_FLASH);

%>
<script>forwardToAddFunds('<%= request.getContextPath()%>/flashError.do?flashError=true')</script>
<%
} else if(null != error && error.equalsIgnoreCase(Global.ERROR_GAME_UNAVAILAB LE)) {
request.setAttribute(Global.GAME_ERROR_KEY, Global.ERROR_GAME_UNAVAILABLE);

%>
<script>forwardToAddFunds('<%= request.getContextPath()%>/gameUnavailableError.do?unavailableError=true')</script>
<%
}else {
%>
<div id="flashGameFile" style="margin-border=1;" >
<script type="text/javascript">
AC_FL_RunContent('classid','clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' ,'codebase','https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0', 'width','790','height','520','src','<%=urlPlayPart %>','quality','high','pluginspage','http://www.macromedia.com/go/getflashplayer', 'movie','<%=request.getContextPath()%>/movies/generic.loader','bgcolor','#6DB344', 'wmode','transparent','id','game','FlashVars','<%= urlParams%>' ); //end AC code
</script>
</div>
<noscript>
<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" style="margin-border=1;" codebase="https://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="790" height="520" id="game" align="middle">
<param name="wmode" value="transparent">
<param name="movie" value=<%=urlPlayPart%> />
<param name="quality" value="high" />
<param name="bgcolor" value="#6DB344" />
<param name=FlashVars value=<%=urlParams%> />
<embed src=<%=urlPlayPart%> quality="high" bgcolor="#6DB344" width="790" height="520" name="game" align="middle" type="application/x-shockwave-flash" pluginspage="https://www.macromedia.com/go/getflashplayer" FlashVars="<%=urlParams%>" wmode="transparent"/>
</object>
</noscript>
<%}%>
</td>

</tr>

<tr class = 'bgcol' style="height: -5;">
<%
String urlForReglement = "#";
if( request.getParameter( "gameId" ).equals( Integer.toString(Global.GAME_ID1) ) ){
urlForReglement = request.getContextPath()+"/lottery/fr/rubbel/elo/pdf/reglement.pdf";
} else if( request.getParameter( "gameId" ).equals( Integer.toString(Global.GAME_ID2) ) ){
urlForReglement = request.getContextPath()+"/lottery/fr/rubbel/okidoki/pdf/reglement.pdf";
}else if( request.getParameter( "gameId" ).equals( Integer.toString(Global.GAME_ID3) ) ){
urlForReglement = request.getContextPath()+"/lottery/fr/rubbel/picco/pdf/reglement.pdf";
}
%>
<td id="reglementOfficiel" style="visibility:hidden;" align ="left" colspan="1"><a href="javascript:#" onclick="showReglement('<%=urlForReglement%>');ret urn false;"><bean:message key="PlayGame.playInstGame.reglementOfficiel"/></a>&nbsp;</td>
<% if( gameType.equals("free") ) {%>
<td align="middle"><img src="<%= request.getContextPath() %>/images/demo_title.gif" border="0" alt="" align="absmiddle"></td>
<% } else {%>
<td align = "left">
<span style="left:120px" id="ticketNumberId"></span>
</td>
<% } %>
<% if( gameType.equals("free") ) {%>
<td align="right" colspan="1"><a href="javascript:#" onclick="childWindowCloseFree();return false;"><bean:message key="PlayGame.playInstGame.quitPlay.Free"/></a></td>
<% } else {%>
<td align="right" colspan="1"><a href="javascript:#" onclick="childWindowClose('<%=request.getContextPa th()%>');return false;"><bean:message key="PlayGame.playInstGame.quitPlay"/></a></td>
<% } %>
</tr>
</table>
<% } %>
</body>[/HTML]
Nov 26 '07 #13

acoder
Expert Mod 15k+
P: 16,027
Please use code tags when posting code.

Have you checked that the "type" request variable is equal to "wager"?

When you view the source, what does confirmExit look like?
Nov 26 '07 #14

Post your reply

Sign in to post your reply or Sign up for a free account.