I have a document center with a custom master page. The page is designed with IE9/HTML5/CSS3 in mind. In my other question, I worked out how to fix the IM Presence icons by fixing some core SharePoint javascript that is defunct as of IE9. This time, I have noticed that when I click the context menus for items in a ListView web part or document library, the "Send To" submenu does not expand. This menu still works in Firefox, but people should just ideally be using IE for SharePoint for most of the functions to work properly. Has anyone else seen this, specifically? I know it must be related to the expandos issue in my other question but I have done a lot of digging and not been able to unearth the key location for the problem. It's like the javascript just stops running somewhere with little or no explanation.


  • Matt

Update 12/7/2012

If you look at the comments for the answer you should get good information on how and where to implement the fix.

  • 2
    To add: I was able to reproduce the issue. All I've changed in my default master page (v4.master) were two things: DOCTYPE tag and the X-UA-Compatible meta tag. The new tags look as follows: <!DOCTYPE html> and <meta http-equiv="X-UA-Compatible" content="IE=9;IE=Edge"/>. After this, I cleared the browser cache, reloaded the page, and beheld the issue. Hope this info will help other experts to participate in answering the question. Commented Feb 3, 2012 at 21:30
  • @omlin Thanks, I should have mentioned that part of it in this post, too.
    – Matt
    Commented Feb 3, 2012 at 22:16
  • Any specific position for core.ie9fix.js, I have tried a couple places in master page, it doesn't work somehow.
    – Shawn
    Commented Dec 5, 2012 at 5:56

1 Answer 1


Comparing execution in IE and in FireFox, I've found out that the problem is that a special "submenuRoot" attribute in IE is not set on the li element, which represents the "Send To" menu node.

After some painful debugging, I've tracked the issue back to method MergeAttributes in the core.js file. This method looks like this:

function MergeAttributes(oTarget, oSource)
    if (browseris.nav || oTarget.mergeAttributes==null)
            // ... code for non-IE browsers, skipped for clarity ...

The oTarget.mergeAttributes(oSource); line, which is obviously the only code which executes in IE, doesn't work as expected. Given oSource.submenuRoot attribute defined and correctly set, after this call, oTarget.submenu remains undefined.

Obviously, the mergeAttributes method works differently for different content modes.

You have several options to fix this, the most obvious would be to override the MergeAttributes function from the masterpage, removing the if condition, and leaving only the first code block. I've tried this, and it works fine (I have IE 9.0.8112.16421).

The fixed code for the function is presented below:

function MergeAttributes(oTarget, oSource)
    var oAttributes=oSource.attributes;
    for (var i=0; i < oAttributes.length; i++)
        var oAttrib=oAttributes[i];
        if (oAttrib !=null &&
            oAttrib.specified &&
            oAttrib.nodeName !="id" &&
            oAttrib.nodeName !="ID" &&
            oAttrib.nodeName !="name")
            oTarget.setAttribute(oAttrib.nodeName, oAttrib.nodeValue);
    if (oSource.getAttribute("type") !=null)
        oTarget.setAttribute("type", oSource.getAttribute("type"));
    if (oSource.submenuRoot !=null)
  • thank you so much for the total solution to this problem! I will implement it on Monday and let you know how it goes!
    – Matt
    Commented Feb 4, 2012 at 23:28
  • Did you have to put this in a specific place? I have tried this and on my server it is still picking the version in core.js over mine. I ended up having to create a file called core.ie9fix.js and place that in the 1033 folder, per the instructions on this page
    – Matt
    Commented Feb 6, 2012 at 2:45
  • 1
    I merely overrode the function on a particular page, using JS console. I don't have a site with HTML5-enabled master page yet, so I didn't try overriding it over the whole site. Probably, as an alternative to your solution, you at least could inject the overload code through _spBodyOnLoadFunctionNames feature. Commented Feb 6, 2012 at 5:57
  • Maybe that's what it is, then. I tried it directly from the master page to begin with. There are a lot of server controls that mess with javascript and I think that was what was doing the stepping-on of your function. At any rate, your suggestion did work, so thanks again!
    – Matt
    Commented Feb 6, 2012 at 15:16
  • You're welcome! Please, don't hesitate to share any further issues, I'm highly interested in HTML5-enabled SharePoint portals :) Commented Feb 6, 2012 at 15:24

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.