Javascript errors in IE7 Options
Carter
Posted: Thursday, March 27, 2008 12:24:56 AM
Rank: Newbie

Joined: 1/24/2008
Posts: 9
With debugging turned on, I get constant errors is IE7, especially when scrolling. It makes the site unusable.
drobar
Posted: Thursday, March 27, 2008 1:09:37 AM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,066
Location: KY, USA
Yes, this is a bug in the forum code.

Details can be found here: http://forum.yetanotherforum.net/yaf_postst4193_XHTML-10-Strict-Compliance.aspx

The solution is either to modify the SmartScroller.cs and recompile, or just change the javascript code by hand in the compiled output.

Hopefully Niels can look into this soon.

cheers,
doug.

MVP 2007/2008 - Official Umbraco Trainer for North America - Percipient Studios
drobar
Posted: Thursday, March 27, 2008 1:31:20 AM

Rank: Umbracoholic

Joined: 9/8/2006
Posts: 1,066
Location: KY, USA
I did a bit more research and it seems that the yaf_GetForm() function is the problem. It uses a simple browser detection switch and treats all Microsoft browsers the same way. The problem is that IE7 (at least in standards-compliance mode) responds differently.

I *think* I have a solution. But I don't have a full forum to test it on so I might be mistaken.

Change the javascript code from:
Code:

  function yaf_GetForm()
  {
    var theform;
    if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1)
    {
      theform = document.ctl00;
    }
    else {
      theform = document.forms["ctl00"];
    }
    return theform;
  }


To something that will also differentiate IE7 from IE6 and older:
Code:

  function yaf_GetForm()
  {
    var theform;
    if (window.navigator.appName.toLowerCase().indexOf("microsoft") > -1)
    {
        if (typeof document.body.style.maxHeight != "undefined")
        {
            //IE7 or newer
            theform = document.forms["ctl00"];
        }
        else
        {
        // less than IE7
        theform = document.ctl00;
        }
    }
    else {
      theform = document.forms["ctl00"];
    }
    return theform;
  }


cheers,
doug.

MVP 2007/2008 - Official Umbraco Trainer for North America - Percipient Studios
Users browsing this topic
Guest


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.