Coffeehouse Thread

8 posts

ASP.NET MVC does not play nice with IE

Back to Forum: Coffeehouse
  • User profile image
    pavone

    So whenever I try to run the default Internet application from ASP.NET MVC with IE, it throws an exception:

    Generic Forum Image

    And the offending piece of code at which it breaks:

    // HACK : override appendChild, replaceChild, insertBefore for IE, since it doesn't support DOM events
        if (isInternetExplorer)
        {
            var appendChildOriginal = doc.body.appendChild;
            doc.body.appendChild = function(element)
            {
                appendChildOriginal(element);
                var tag = element.tagName.toLowerCase();
                
                if ("video" == tag)
                {
                    ProcessVideoElement(element);
                }
            }
    
           ....
    }

    I can simply continue but it's very annoying. So is there way to disable this error? 

  • User profile image
    Harlequin

    IE10?

  • User profile image
    pavone

    Both IE9 and IE10. Haven't tested IE8 but doesn't it use the same javascript engine.. I figure there's some configuration or flag in VS2012 (using MVC 4.0 btw) I need to set. Note that this is the default template, I have not added a single line of code.  

  • User profile image
    ZippyV

    This has nothing to do with asp.net mvc as this is a javascript error. Where does this javascript come from?

  • User profile image
    PopeDai

    , ZippyV wrote

    This has nothing to do with asp.net mvc as this is a javascript error. Where does this javascript come from?

    It's a widely-reported issue with the version of jQuery that ships with ASP.NET. Search for "override appendChild, replaceChild, insertBefore for IE" (with quotes) and you'll see a load of threads on other sites about this.

     

  • User profile image
    pavone

    Thanks PopeDai, your search query led me to the right solution. Turned out to be my DivX plug-in for IE, same plug-in in other browsers (Chrome, FF) works fine though. 

  • User profile image
    PopeDai

    , pavone wrote

    Thanks PopeDai, your search query led me to the right solution. Turned out to be my DivX plug-in for IE, same plug-in in other browsers (Chrome, FF) works fine though. 

    Interesting. I'll pass this on.

  • User profile image
    blowdart

    , pavone wrote

    Thanks PopeDai, your search query led me to the right solution. Turned out to be my DivX plug-in for IE, same plug-in in other browsers (Chrome, FF) works fine though. 

    The DivX plugin writes javascript so it appends tracking cookies all over the place, by inserting its own script tag in every page.

    It's not a nice plug-in at all

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.