window.onunload does not work in IE6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • rakeshvthu
    New Member
    • May 2007
    • 27

    window.onunload does not work in IE6

    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:
    [CODE=javascript]<script>
    window.onunload = confirmExit;

    function confirmExit(){
    if( !flag ){
    window.opener.l ocation.href = "<%= request.getCont extPath() %>"+"/postHome.do";
    }
    }
    </script>
    [/CODE]
    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.
    Last edited by acoder; Nov 20 '07, 11:47 AM. Reason: Added code tags
  • acoder
    Recognized Expert MVP
    • Nov 2006
    • 16032

    #2
    onunload should work in IE6 as far as I'm aware.

    Where do set the flag variable?

    Have you tried onbeforeunload instead?

    Comment

    • rakeshvthu
      New Member
      • May 2007
      • 27

      #3
      Originally posted by acoder
      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.

      Comment

      • acoder
        Recognized Expert MVP
        • Nov 2006
        • 16032

        #4
        Post the onbeforeunload code.

        Comment

        • rakeshvthu
          New Member
          • May 2007
          • 27

          #5
          Originally posted by acoder
          Post the onbeforeunload code.
          i have used the same code for onbeforeunload which i have used for onunload

          Comment

          • acoder
            Recognized Expert MVP
            • Nov 2006
            • 16032

            #6
            Check that window.opener still refers to the parent.

            Also, is the value of flag false?

            Comment

            • rakeshvthu
              New Member
              • May 2007
              • 27

              #7
              Originally posted by acoder
              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.

              Comment

              • acoder
                Recognized Expert MVP
                • Nov 2006
                • 16032

                #8
                Does this example work in IE6?

                Comment

                • rakeshvthu
                  New Member
                  • May 2007
                  • 27

                  #9
                  Originally posted by acoder
                  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

                  Comment

                  • acoder
                    Recognized Expert MVP
                    • Nov 2006
                    • 16032

                    #10
                    So even the W3Schools example is not working?

                    You have IE6 on Linux?!

                    Comment

                    • rakeshvthu
                      New Member
                      • May 2007
                      • 27

                      #11
                      Originally posted by acoder
                      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

                      Comment

                      • acoder
                        Recognized Expert MVP
                        • Nov 2006
                        • 16032

                        #12
                        Can you post the whole page code to test?

                        Comment

                        • rakeshvthu
                          New Member
                          • May 2007
                          • 27

                          #13
                          Originally posted by acoder
                          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.gte ch.esi.core.sys tem.util.Global ApplicationObje ct" %>
                          <%@ page import="com.gte ch.esi.core.sys tem.Global" %>
                          <%@ page import="com.gte ch.esi.core.sys tem.notificatio n.Notification" %>
                          <%@ page import="com.gte ch.esi.core.gui .player.game.in stant.form.Show GameDetailForm" %>
                          <%@ page import="com.gte ch.esi.core.gui .player.uam.Pla yerBean" %>
                          <%@ page import="org.apa che.struts.Glob als" %>
                          <%@ page import="java.te xt.NumberFormat "%>
                          <%@ page import="java.ut il.Locale"%>

                          <%@ page import="java.te xt.DecimalForma t"%>
                          <%@ page import="java.te xt.DecimalForma tSymbols" %>

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

                          [/HTML][CODE=javascript] <script type="text/javascript">
                          //nsingh Added for capturing cross browser backspace button
                          document.onkeyd own = function(e) {handleKeys(e)}
                          document.onkeyp ress = function(e) {handleKeys(e)}
                          function handleKeys(e) {
                          if(e)
                          {
                          if (e.stopPropagat ion) {
                          e.stopPropagati on();
                          e.preventDefaul t();
                          }
                          } else{
                          window.event.ca ncelBubble = true; //IE reports window.event not arg
                          window.event.re turnValue = false; //IE reports window.event not arg

                          }
                          }
                          if (document.image s)
                          {
                          img1 = new Image();
                          img2 = new Image();
                          img3 = new Image();
                          img4 = new Image();
                          img5 = new Image();
                          img1.src = "<%= request.getCont extPath() %>/images/logo.gif";
                          img2.src = "<%= request.getCont extPath() %>/images/btn_select_demo .gif" ;
                          img3.src = "<%= request.getCont extPath() %>/images/btn_autrex_jue. gif" ;
                          img4.src = "<%= request.getCont extPath() %>/images/btn_transfer.gi f" ;
                          img5.src = "<%= request.getCont extPath() %>/images/white_point.gif " ;
                          }
                          </script>
                          [/CODE]


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

                          <style>
                          .bgcol{backgrou nd-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][CODE=javascript] if (navigator.user Agent.indexOf(" MSIE") >= 0)
                          {
                          document.writel n("<style> .menulist li.cat { border-top: 1px solid #3f7437; } </style>");
                          }else if (navigator.user Agent.indexOf(" Firefox") >= 0)
                          {
                          document.writel n("<style> .menulist li.cat { border:1px solid #3f7437; border-left-width: 0px;} </style>");
                          document.writel n("<style> #dropdown li.cat { border-top:1px solid #3f7437;} </style>");
                          }
                          else{
                          document.writel n("<style> .menulist li.cat { border-top: 1px solid #3f7437; } </style>");
                          }
                          </script>

                          <script>
                          if (navigator.user Agent.indexOf(" MSIE") >= 0)
                          {
                          document.writel n("<style> .fontprice { float:right; } </style>");
                          }else if (navigator.user Agent.indexOf(" Firefox") >= 0)
                          {
                          document.writel n("<style> .fontprice { margin-top:-20px; } </style>");
                          }
                          else{
                          document.writel n("<style> .fontprice { margin-top:-20px; } </style>");
                          }
                          </script>

                          <script>
                          if (navigator.user Agent.indexOf(" MSIE") >= 0)
                          {
                          document.writel n("<style> .gameStyle { float:left; } </style>");
                          }else if (navigator.user Agent.indexOf(" Firefox") >= 0)
                          {
                          document.writel n("<style> .gameStyle { margin-left:0px; } </style>");
                          }else if (navigator.user Agent.indexOf(" Opera") >= 0)
                          {
                          document.writel n("<style> .gameStyle { margin-left:-50px; } </style>");
                          }
                          else{
                          document.writel n("<style> .gameStyle { margin-left:-70px; } </style>");
                          }
                          </script>

                          <script type="text/javascript" >

                          function displayTicketNu mber(ticketNumb er){
                          if(ticketNumber ){
                          document.getEle mentById("ticke tNumberId").inn erHTML = ticketNumber;
                          document.getEle mentById("ticke tNumberId").sty le.visibility=" visible";
                          }
                          }

                          function doNotDisplayTkt Number(){
                          if( document.getEle mentById("ticke tNumberId")){
                          document.getEle mentById("ticke tNumberId").sty le.visibility=" hidden";
                          }
                          }

                          function displayWalletBa lance(ticketNum ber,walletBalan ce){
                          if( document.getEle mentById("walle tBalanceId") ){
                          document.getEle mentById("walle tBalanceId").in nerHTML = walletBalance;
                          document.getEle mentById("walle tBalanceId").st yle.visibility= "visible";
                          document.getEle mentById("walle tBalanceId").st yle.width="";
                          document.getEle mentById("walle tBalanceId").st yle.height="";
                          }
                          window.opener.p arent.globalPop upCtr = new Date().getTime( );
                          if( document.getEle mentById("ticke tNumberId") ){
                          document.getEle mentById("ticke tNumberId").inn erHTML = '<bean:message key="PlayGame.p layInstGame.tic ketNumber"/>'+'<b>'+ticket Number+'</b>';
                          document.getEle mentById("ticke tNumberId").sty le.visibility=" visible";
                          }
                          }

                          function hideAll() {
                          if( document.getEle mentById("walle tBalanceId") )
                          document.getEle mentById("walle tBalanceId").st yle.visibility= "hidden";
                          if( document.getEle mentById("trans ferFunds") )
                          document.getEle mentById("trans ferFunds").styl e.visibility = 'hidden';
                          if( document.getEle mentById("walle tBalance") )
                          document.getEle mentById("walle tBalance").styl e.visibility = 'hidden';
                          if( document.getEle mentById("regle mentOfficiel") )
                          document.getEle mentById("regle mentOfficiel"). style.visibilit y = 'hidden';
                          if( document.getEle mentById("dropD ownId") )
                          document.getEle mentById("dropD ownId").style.v isibility = 'hidden';
                          }

                          function showAll() {

                          if( document.getEle mentById("walle tBalanceId") )
                          document.getEle mentById("walle tBalanceId").st yle.visibility= "visible";
                          if( document.getEle mentById("trans ferFunds") )
                          document.getEle mentById("trans ferFunds").styl e.visibility = 'visible';
                          if( document.getEle mentById("walle tBalance") )
                          document.getEle mentById("walle tBalance").styl e.visibility = 'visible';
                          if( document.getEle mentById("regle mentOfficiel") )
                          document.getEle mentById("regle mentOfficiel"). style.visibilit y = 'visible';
                          if( document.getEle mentById("dropD ownId") )
                          document.getEle mentById("dropD ownId").style.v isibility = 'visible';

                          listMenu.activa teMenu("listMen uRoot", arrow);

                          }

                          //Added by nsingh

                          var flag = false;

                          document.oncont extmenu=new Function("retur n false");

                          function rightClick(e) {
                          if (navigator.appN ame == 'Netscape' && (e.which == 3 || e.which == 2))
                          return false;
                          else if (navigator.appN ame == 'Microsoft Internet Explorer' &&
                          (event.button == 2 || event.button == 3))
                          {
                          return false;
                          }
                          return true;
                          }

                          document.onmous edown=rightClic k;
                          document.onmous eup=rightClick;

                          if (document.layer s) window.captureE vents(Event.MOU SEDOWN);
                          if (document.layer s) window.captureE vents(Event.MOU SEUP);

                          window.onmoused own=rightClick;
                          window.onmouseu p=rightClick;
                          window.onunload = confirmExit;
                          //document.onmous edown = shiftEnter;



                          function shiftEnter(e) {
                          if (event.shiftKey ) {
                          var msg = "<bean:mess age key='home.playe r.operationNotA llowed' />";
                          alert(msg);
                          return false;
                          }
                          }

                          function setValue(){
                          flag = true;
                          }

                          function confirmExit(){
                          <%
                          if(null!=reques t.getParameter( "type" ) )
                          if(request.getP arameter( "type" ).equals("wager ")) { %>
                          if( !flag ){
                          window.opener.l ocation.href = "<%= request.getCont extPath() %>"+"/postHome.do";
                          }
                          <%}%>
                          }
                          //Added by nsingh

                          function activateFlash(o bj){
                          objects = document.getEle mentsByTagName( obj);
                          for (var i = 0; i < objects.length; i++){
                          objects[i].outerHTML = objects[i].outerHTML;
                          }
                          }

                          </script>

                          <script type="text/javascript">
                          function ShowMenu() {
                          if (document.getEl ementById('fram e1'))
                          document.getEle mentById("frame 1").style.displ ay = "inline";
                          }
                          function HideMenu() {
                          if (document.getEl ementById('fram e1'))
                          document.getEle mentById("frame 1").style.displ ay = "none";
                          }
                          function ShowMenu2() {
                          if (document.getEl ementById('fram e2'))
                          document.getEle mentById("frame 2").style.displ ay = "inline";
                          }
                          function HideMenu2() {
                          if (document.getEl ementById('fram e2'))
                          document.getEle mentById("frame 2").style.displ ay = "none";
                          }
                          </script>[/CODE]
                          [CODE=javascript]<script>
                          function childWindowClos e(contextPath){
                          //alert("window.o pener.location :" + window.opener.l ocation);
                          flag = true;
                          window.opener.l ocation.href = contextPath+"/gaming/viewGameLobby.d o?mode=display" ;
                          self.close();
                          }

                          function childWindowClos eFree(){
                          flag = true;
                          self.close();
                          }

                          function forwardToAddFun ds(url){
                          if( self.opener ){
                          flag = true;
                          self.window.clo se();
                          window.opener.l ocation.href = url;
                          }
                          }


                          function showReglement(u rl){
                          window.open(url );
                          }

                          function openFlash(){
                          if(self.opener) {
                          flag = true;
                          window.open('ht tp://www.adobe.com', 'newWindow','ta rget=blank,addr essbar=yes,menu bar=yes,status= yes,scrollbars= yes,resizable=y es');
                          parent.window.c lose();
                          }
                          }
                          [/CODE][HTML]</script>
                          </head>


                          <body id="play">
                          <bean:define id="currentBala nce" name="purchaseI nstGameForm" type="java.lang .String" property="walle tBalance"/>[/HTML]
                          [CODE=java]<%
                          Locale myLocale = new Locale(GlobalAp plicationObject .getInstance(). getSetting(Glob al.SETTING_SYST EM_LOCALE_LANG) ,
                          GlobalApplicati onObject.getIns tance().getSett ing(Global.SETT ING_SYSTEM_LOCA LE_COUNTRY));
                          NumberFormat numberFormatter = NumberFormat.ge tCurrencyInstan ce(myLocale);

                          DecimalFormatSy mbols dSymbols = new DecimalFormatSy mbols(myLocale) ;
                          dSymbols.setGro upingSeparator( '.');

                          ((DecimalFormat )numberFormatte r).setDecimalFo rmatSymbols(dSy mbols);
                          %>
                          <jsp:useBean id="purchaseIns tGameForm" scope="request" class="com.gtec h.esi.core.gui. player.game.ins tant.form.Purch aseInstantForm" />
                          <%
                          //This is needed since the page is refreshing and hence the way the url getData url is going to get constructed again
                          String genericLoader = request.getCont extPath() + "/movies/generic.loader. swf?";
                          String gamePrefix = purchaseInstGam eForm.getGamePr efix();
                          String gameId = request.getPara meter( "gameId" );
                          String flashVer = request.getPara meter( "flashVersi on" );
                          String gameType = request.getPara meter( "type" );
                          String mode = request.getPara meter( "mode" );
                          String gameTimeout = GlobalApplicati onObject.getIns tance().getSett ing( Global.SETTING_ PLAYER_SESSIONT IME );
                          String recoverDataSour ce = "recover_dataso urce=NIL";
                          String purchaseDataSou rce = "purchase_datas ource=/player/gaming/wager/purchaseInstGam e.do?gameId="+g ameId+"&type="+ gameType+"&mode =process";
                          String endGameDataSour ce = "endgame_dataso urce=/player/gaming/endGameExitPres sed.do?gameId=" +gameId+"&type= "+gameType+"&mo de=process";

                          if( request.getAttr ibute("recover" ) != null && ((String)reques t.getAttribute( "recover")).equ als("true"))
                          {
                          recoverDataSour ce = "recover_dataso urce=/player/gaming/wager/purchaseInstGam e.do?gameId="+g ameId+"&type="+ gameType+"&reco ver_mode=recove r";
                          request.removeA ttribute("recov er");
                          }

                          String urlParams = "flashGame= " + request.getCont extPath() + "/movies/" + gamePrefix + "/"
                          + "&gameID=" + gameId
                          + "&flashVersion= " + flashVer
                          + "&type=" + gameType
                          + "&sess_to=" + gameTimeout
                          + "&ticketID= " + "TEST"
                          + "&gameProvider= " + "TEST"
                          + "&gamePrefi x=" + gamePrefix
                          + "&played="
                          + "&"
                          + purchaseDataSou rce
                          +"&"
                          + recoverDataSour ce
                          +"&"
                          + endGameDataSour ce;



                          String urlPlayPart = genericLoader + urlParams;// commented this since it is included in urlparams.+ purchaseDataSou rce;

                          %>

                          <%
                          String errorCode = (String) request.getAttr ibute(Global.GA ME_ERROR_KEY);
                          if(errorCode !=null && errorCode.equal s(Global.ERROR_ INSUFFICIENT_FL ASH)){

                          %>
                          <table>
                          <tr>
                          <td>
                          <bean:message key="PlayInstGa me.FlashError.e rrorCopy1"/>&nbsp;
                          <a href="#" onclick='javasc ript:openFlash( );'><bean:messa ge key="PlayInstGa me.FlashError.e rrorCopy3"/></a>
                          &nbsp;<bean:mes sage key="PlayInstGa me.FlashError.e rrorCopy2"/>
                          </td>
                          </tr>
                          </table>
                          <%
                          }else{
                          %>

                          <script>
                          if (navigator.user Agent.indexOf(" MSIE") >= 0)
                          {
                          document.writel n("<table align='center' border='0' style='margin-left:-6px;margin-top:-5px'>");
                          }else if(navigator.us erAgent.indexOf ("Firefox") >= 0)
                          {
                          document.writel n("<table align='center' style='margin-left:4px;'>");
                          }
                          </script>


                          <tr>
                          <td>
                          <img src="<%=request .getContextPath ()%>/images/logo.gif" style="position :absolute;top:5 px; margin-top:0px;">
                          </td>
                          <% if( gameType.equals ("free") ) {%>
                          <td style="position :absolute; top:5px; left:420px" >
                          <object type="applicati on/x-shockwave-flash" data="<%=reques t.getContextPat h()%>/lottery/fr/flash/demo.swf" style="margin-bottom: 5px; position: relative; top: -3px; left: -160px;" height="38" width="300" onload="activat eFlash(this)">
                          <param name="movie" value="<%=reque st.getContextPa th()%>/lottery/fr/flash/demo.swf">
                          </object>
                          </td>
                          <% } %>
                          <% if( !gameType.equal s("free") ) {
                          PlayerBean playerBean = (PlayerBean) request.getSess ion().getAttrib ute(
                          Global.SESSION_ PLAYER_DATA);
                          if(playerBean.g etPaymentcardAc count() != null){
                          %>
                          <td align="right" id="transferFun ds" style="position :absolute; top:5px; left:440px; visibility:hidd en;" ><a href="javascrip t:#"><img onclick="forwar dToAddFunds('/player/account/wallet/landing.do?acti on=add');return false;" src="<%= request.getCont extPath() %>/images/btn_transfer.gi f" border="0" alt="" align="absmiddl e"></a></td>
                          <%} else {
                          %>
                          [/CODE][HTML] <td align="right" id="transferFun ds" style="position :absolute; top:5px; left:440px; visibility:hidd en;" ><a href="javascrip t:#"><img onclick="forwar dToAddFunds('/player/account/wallet/landing.do?acti on=changeDebitC ard');return false;" src="<%= request.getCont extPath() %>/images/btn_transfer.gi f" border="0" alt="" align="absmiddl e"></a></td>
                          <% }} %>

                          <td id="dropDownId " style="visibili ty:hidden;">
                          [/HTML]
                          [CODE=java] <%
                          String leftWidth = "220px";
                          if(!gameType.eq uals("free")){
                          leftWidth = "220px";
                          } else if( gameType.equals ("free") ){
                          leftWidth = "600px";
                          }
                          %>
                          [/CODE]
                          [HTML] <ul class="menulist " id="listMenuRoo t" style="position :absolute; top:5px; left:<%=leftWid th%>; margin:0px; padding:0px;">
                          <li>
                          [/HTML]
                          [CODE=java] <% if( gameType.equals ("free") ) {%>
                          <a href="javascrip t:#"><img src="<%= request.getCont extPath() %>/images/btn_select_demo .gif" border="0" alt="" width="200" align="absmiddl e"></a>
                          <% } else {%>
                          <a href="javascrip t:#"><img src="<%= request.getCont extPath() %>/images/btn_autrex_jue. gif" border="0" alt="" align="absmiddl e"></a>
                          <% } %>
                          [/CODE]
                          [HTML] <ul class="sub" id="dropdown">
                          <li class="cat" style="width:19 5px">&nbsp;</li>

                          <logic:notEmp ty name="purchaseI nstGameForm" property="allIn stGames">
                          <logic:iterat e id="instGames" name="purchaseI nstGameForm" property="allIn stGames" type="com.gtech .esi.ire.core.p layer.game.area .value.GameAttr ibutesVO">
                          <li class="cat" style="width:19 5px">

                          <% if( gameType.equals ("free") ) { %>
                          <script>[/html]
                          [CODE=javascript] if (navigator.user Agent.indexOf(" MSIE") >= 0){
                          //alert("IE");
                          document.writel n("<span style='position :absolute; left:0px; clear:left; float:left'>");
                          }else if(navigator.us erAgent.indexOf ("Firefox") >= 0){
                          //alert("FF");
                          document.writel n("<span style='position :relative;left: 0px; clear:left;'>") ;
                          }
                          [/CODE][HTML] </script>
                          &nbsp;&nbsp;

                          <img src="<%=request .getContextPath ()%>/images/white_point.gif " style="vertical-align:middle ">&nbsp;&nb sp;
                          <a href="<%=reques t.getContextPat h()%>/gaming/wager/purchaseInstGam e.do?mode=displ ay&type=<%=game Type%>&gameId=< bean:write name='instGames ' property='gameI d'/>&flashVersion= " class="fontdrop " onclick="setVal ue()"><bean:wri te name="instGames " property="gameN ame"/>
                          </a>
                          </span>
                          <script>
                          if (navigator.user Agent.indexOf(" MSIE") >= 0){
                          document.writel n("<span class='fontpric e'>");
                          }else if(navigator.us erAgent.indexOf ("Firefox") >= 0){
                          document.writel n("<span class='fontpric e' style='float:ri ght;'>");
                          }
                          </script>
                          <bean:write name="instGames " property="gameC ost"/> &euro;&nbsp; </span>
                          <% } else { %>

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

                          <img src="<%=request .getContextPath ()%>/images/white_point.gif " style="vertical-align:middle ">&nbsp;&nb sp;
                          <a href="<%=reques t.getContextPat h()%>/gaming/wager/purchaseInstGam e.do?mode=displ ay&type=<%=game Type%>&gameId=< bean:write name='instGames ' property='gameI d'/>&flashVersion= " class="fontdrop " onclick="setVal ue()"><bean:wri te name="instGames " property="gameN ame"/>
                          </a>
                          </span>
                          <script>
                          if (navigator.user Agent.indexOf(" MSIE 6") >= 0){
                          document.writel n("<span class='fontpric e'>");
                          } else if(navigator.us erAgent.indexOf ("MSIE 7") >= 0){
                          document.writel n("<span class='fontpric e'>");
                          } else if(navigator.us erAgent.indexOf ("Firefox") >= 0){
                          document.writel n("<span class='fontpric e' style='float:ri ght;'>");
                          }
                          </script>
                          <bean:write name="instGames " property="gameC ost"/> &euro;&nbsp; </span>
                          <% } %>
                          </li>

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

                          </ul>

                          </li>
                          </ul>

                          </td>
                          [/HTML]
                          [CODE=java] <% if( !gameType.equal s("free") ) {%>
                          <td align="right" id="walletBalan ce" style="position :absolute; top:20px; left:660px; visibility:hidd en;"><bean:mess age key="PlayGame.p layInstGame.wal letBalance"/><span style="font:bol d; left:620px;" id="walletBalan ceId"></span> </td>
                          <% } %>
                          [/CODE][HTML] </tr>
                          <script>display WalletBalance(' ','<%=currentBa lance%>'); </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.getAttr ibute(Global.GA ME_ERROR_KEY);

                          if(null != error && error.equalsIgn oreCase(Global. ERROR_INSUFFICI ENT_FLASH)){
                          request.setAttr ibute(Global.GA ME_ERROR_KEY, Global.ERROR_IN SUFFICIENT_FLAS H);

                          %>
                          <script>forward ToAddFunds('<%= request.getCont extPath()%>/flashError.do?f lashError=true' )</script>
                          <%
                          } else if(null != error && error.equalsIgn oreCase(Global. ERROR_GAME_UNAV AILABLE)) {
                          request.setAttr ibute(Global.GA ME_ERROR_KEY, Global.ERROR_GA ME_UNAVAILABLE) ;

                          %>
                          <script>forward ToAddFunds('<%= request.getCont extPath()%>/gameUnavailable Error.do?unavai lableError=true ')</script>
                          <%
                          }else {
                          %>
                          <div id="flashGameFi le" style="margin-border=1;" >
                          <script type="text/javascript">
                          AC_FL_RunConten t('classid','cl sid:d27cdb6e-ae6d-11cf-96b8-444553540000' ,'codebase','ht tps://download.macrom edia.com/pub/shockwave/cabs/flash/swflash.cab#ver sion=9,0,0,0', 'width','790',' height','520',' src','<%=urlPla yPart%>','quali ty','high','plu ginspage','http ://www.macromedia. com/go/getflashplayer' , 'movie','<%=req uest.getContext Path()%>/movies/generic.loader' ,'bgcolor','#6D B344', 'wmode','transp arent','id','ga me','FlashVars' ,'<%=urlParams% >' ); //end AC code
                          </script>
                          </div>
                          <noscript>
                          <object classid="clsid: d27cdb6e-ae6d-11cf-96b8-444553540000" style="margin-border=1;" codebase="https ://fpdownload.macr omedia.com/pub/shockwave/cabs/flash/swflash.cab#ver sion=9,0,0,0" width="790" height="520" id="game" align="middle">
                          <param name="wmode" value="transpar ent">
                          <param name="movie" value=<%=urlPla yPart%> />
                          <param name="quality" value="high" />
                          <param name="bgcolor" value="#6DB344" />
                          <param name=FlashVars value=<%=urlPar ams%> />
                          <embed src=<%=urlPlayP art%> quality="high" bgcolor="#6DB34 4" width="790" height="520" name="game" align="middle" type="applicati on/x-shockwave-flash" pluginspage="ht tps://www.macromedia. com/go/getflashplayer" FlashVars="<%=u rlParams%>" wmode="transpar ent"/>
                          </object>
                          </noscript>
                          <%}%>
                          </td>

                          </tr>

                          <tr class = 'bgcol' style="height: -5;">
                          <%
                          String urlForReglement = "#";
                          if( request.getPara meter( "gameId" ).equals( Integer.toStrin g(Global.GAME_I D1) ) ){
                          urlForReglement = request.getCont extPath()+"/lottery/fr/rubbel/elo/pdf/reglement.pdf";
                          } else if( request.getPara meter( "gameId" ).equals( Integer.toStrin g(Global.GAME_I D2) ) ){
                          urlForReglement = request.getCont extPath()+"/lottery/fr/rubbel/okidoki/pdf/reglement.pdf";
                          }else if( request.getPara meter( "gameId" ).equals( Integer.toStrin g(Global.GAME_I D3) ) ){
                          urlForReglement = request.getCont extPath()+"/lottery/fr/rubbel/picco/pdf/reglement.pdf";
                          }
                          %>
                          <td id="reglementOf ficiel" style="visibili ty:hidden;" align ="left" colspan="1"><a href="javascrip t:#" onclick="showRe glement('<%=url ForReglement%>' );return false;"><bean:m essage key="PlayGame.p layInstGame.reg lementOfficiel"/></a>&nbsp;</td>
                          <% if( gameType.equals ("free") ) {%>
                          <td align="middle"> <img src="<%= request.getCont extPath() %>/images/demo_title.gif" border="0" alt="" align="absmiddl e"></td>
                          <% } else {%>
                          <td align = "left">
                          <span style="left:120 px" id="ticketNumbe rId"></span>
                          </td>
                          <% } %>
                          <% if( gameType.equals ("free") ) {%>
                          <td align="right" colspan="1"><a href="javascrip t:#" onclick="childW indowCloseFree( );return false;"><bean:m essage key="PlayGame.p layInstGame.qui tPlay.Free"/></a></td>
                          <% } else {%>
                          <td align="right" colspan="1"><a href="javascrip t:#" onclick="childW indowClose('<%= request.getCont extPath()%>');r eturn false;"><bean:m essage key="PlayGame.p layInstGame.qui tPlay"/></a></td>
                          <% } %>
                          </tr>
                          </table>
                          <% } %>
                          </body>[/HTML]
                          Last edited by acoder; Nov 26 '07, 12:20 PM. Reason: Added code tags

                          Comment

                          • acoder
                            Recognized Expert MVP
                            • Nov 2006
                            • 16032

                            #14
                            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?

                            Comment

                            Working...