Re: DotNet Gallery only partially works under Firefox

  •  07-19-2006, 3:36 AM

    Re: DotNet Gallery only partially works under Firefox

    Due to a bug/feature of Javascript, the last function in always wins.  This means that you can have multiple function signatures and the last one defined will be the one that the browser uses.

    DIY solution for broken proceed(szHow,n)  function:
    (Put this code somewhere after the control pastes its own script code - I put it toward the </body> tag to be safe)

    <script language="javascript">
         function proceed(szHow,n)
         {
             var theform;
             if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1) //If Gecko agent
             {
                 theform = document.forms["form1"];
                 var temp,temp1;
                 temp = GetElementByName2(theform,"gallery$currentpage"); //Changed : to $
                 temp1 = GetElementByName2(theform,"gallery$current_slideshow"); //Changed : to $
                 temp.value=n;
                 temp1.value=szHow;
             }
             else //If IE
             {
                 theform = document.form1;
                 theform.gallery_currentpage.value=n;
               
                 theform.gallery_current_slideshow.value=szHow;
             }
             if(szHow=="Slideshow")
                 window.setTimeout("__doPostBack('gallery','')", 3000);
             else
                __doPostBack('gallery','')
         }
    </script>

    Now this solution checks out in Firefox, Camino, Safari, and IE.  I haven't actually tried it on Netscape Navigator, but if it gives you problems, you can always include a separate test:

    if (window.navigator.appName.toLowerCase().indexOf("netscape") > -1)
    {
            theform = document.forms["form1"];
            var temp,temp1;
            temp = GetElementByName2(theform,"gallery:currentpage");
            temp1 = GetElementByName2(theform,"gallery:current_slideshow");
            temp.value=n;
            temp1.value=szHow;
    }
    else if (window.navigator.appName.toLowerCase().indexOf("firefox") > -1)
    {
            theform = document.forms["form1"];
            var temp,temp1;
            temp = GetElementByName2(theform,"gallery$currentpage"); //Changed : to $
            temp1 = GetElementByName2(theform,"gallery$current_slideshow"); //Changed : to $
            temp.value=n;
            temp1.value=szHow;
    }

    I hope this helps, although my favorite solution is Cutesoft fixing their product on their own.

    Matt

View Complete Thread