Web Analytics Made Easy -
StatCounter something nonstandard in the following javascript? - CodingForum

Announcement

Collapse
No announcement yet.

something nonstandard in the following javascript?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • something nonstandard in the following javascript?

    Im battling with some old legacy code that works perfectly fine in IE 6.0 but does not work in firefox. Basically, this code snippet is part of an elaborate .js file to display a Menu. Again, it displays fine in IE but not firefox. So, I was wondering if there is anything nonstandard in the code below. There is much more code in the .js file, but I have confirmed that the work done by this file works fine in IE but not firefox. Thanks for reading it over, any help greatly appreciated.


    function Menu(name, toolTip, statusBar, url, isActive){
    var insertHTML;
    this.id = "menu" + menuCounter;
    this.contentID = this.id + "_content";

    //insert the top entry in the navBar
    insertHTML = "<span id=\"" + this.id + "\" ";
    if (isActive == "true"){
    insertHTML += "class=\"active\" ";
    insertHTML += "style=\"padding-right=15px;padding-left=15px;Width:100px;FONT-SIZE: 10pt;COLOR: " + navBarTextOver + ";FONT-FAMILY: Verdana;POSITION: relative;BACKGROUND-COLOR: " + navBarHighlight + ";TEXT-ALIGN: center;cursor:'hand';\" ";
    } else {
    insertHTML += "style=\"padding-right=15px;padding-left=15px;Width:100px;FONT-SIZE: 10pt;COLOR: " + navBarText + ";FONT-FAMILY: Verdana;POSITION: relative;BACKGROUND-COLOR: " + navBarBackground + ";TEXT-ALIGN: center;cursor:'hand';\" ";
    }
    insertHTML += "onmouseover=\"clearCloseTimeout();hoverOver(this);showIt(" + menuCounter + ");event.cancelBubble='true';\" onmouseout=\"hoverOut(this);\" ";
    insertHTML += "onmousemove=\"window.status='" + statusBar + "'\" title=\"" + toolTip + "\" ";
    insertHTML += "onclick=\"showIt(" + menuCounter + ")";
    if (url != ""){
    var tempURL = new String(url);
    if ((tempURL.toLowerCase()).indexOf("javascript") > -1
    || (tempURL.toLowerCase()).indexOf("(") > -1){
    insertHTML += ";" + url + "\" ";
    } else {
    url = url.replace(/[']/g, "%27");
    insertHTML += ";jump('" + url + "');\" ";
    }
    } else {
    //we're not adding a jump for a url, so close the onclick section
    insertHTML += "\" ";
    }//end if statement to check if url != ""

    insertHTML += ">" + name + "</span>";
    document.getElementById("app_navBarHolder").insertAdjacentHTML("beforeEnd", insertHTML);

    //create the hidden section that will contain all the HTML for this popUp
    insertHTML = "<div id=\"" + this.contentID + "\" style=\"position:absolute;visibility:hidden;width:100%;\"></div>";
    document.getElementById("app_navBarHolder").insertAdjacentHTML('beforeEnd', insertHTML);

    this.hasChildren = false;
    this.popUp = window.createPopup();
    this.popUp.document.body.style.cursor = 'hand';
    this.popUp.document.body.style.border = "1 solid " + dropDownBorder;
    this.popUp.document.onmouseover = clearCloseTimeout;
    this.popUp.document.onmouseout = startPopUpClose;
    this.relativeObj = eval("menu" + menuCounter);
    this.width = 0;
    this.height = 0;
    this.entryCounter = 0;
    this.addEntry = addEntry;
    this.insertHorizontalDivider = insertHorizontalDivider;

    popUps.push(this);
    menuCounter++;
    }

  • #2
    events are captured in different modes in IE and in Moz/Netscape.

    Anather small problem... Use CSS style cursorointer (cross-browser) instead of cursor:hand (IE only).
    KOR
    Offshore programming
    -*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*

    Comment


    • #3
      thanks. I Also found doing some of my own googling on several things in the function that createPopup is a IE only function. Is there any replacement for it in firefox? Has anybody templated a version to replace it? that would be most helpful if so, thanks!!

      Comment

      Working...
      X