IE7 & IE8 error executing function with ajax

I am loading an ajax page which executes an HTML5 video player script. The function for the Flash fallback is html5media(); :

//Load 1st Case Study
    $("#splash").live('click', function (e) {
        $(this).fadeOut('slow', function () {
            $('#case-studies').load('case-study-1.html', function() {
               html5media(); //initiate Flash fallback
            }).fadeIn();

        });
        e.preventDefault();
    });

This initial page load works fine in IE7 & IE8.

  • How DIV scrolls in chat script?
  • A more graceful way of throttling jQuery $().each?
  • initial data loading in angularjs
  • Detecting Back Button/Hash Change in URL
  • Disqus comment count issue on angular
  • create a new option and inject into select box using mootools 1.2
  • The problem is once this page is loaded, there are links to 4 more videos which are loaded in again using ajax. I use this function:

    //Switcher
    function csClients(url, client) {
        $("#case-studies").fadeOut('slow', function() {
            $('#case-studies').load(url, function () {
                html5media(); //initiate Flash fallback
            }).fadeIn();
        });
    }
    
    //Page Loader
    $("#cs-client-list li.client1 a").live('click', function(e) {
        csClients('case-study-1.html', 'client1');
        e.preventDefault();
    });
    

    Originally I was using return false; but none of the sub-page Flash videos would load in IE7. When I switched to preventDefault, the videos loaded in IE7 but still not in IE8.

    I also get a weird error in both IE7 & IE8 with no helpful feedback:

    Error on Page:

    Unspecified error.

    / (Line 49)

    Code: 0 (Char 5) URI:

    http://www.mysite.com

    This is line 49 in my index page:

    <section id="case-studies" class="main-section">
    

    I have a feeling it has to do with calling html5media(); too many times? At a loss…

  • How do I pass params to Rails controller method then return value using JQuery/AJAX?
  • Is there a better way to create asynchronous updates without using setInterval?
  • How to get a div text from html content
  • how to pass parameters on reload of datatables
  • Rewriting jQuery to plain old JavaScript - are the performance gains worth it?
  • Send information from the WCF to JavaScript
  • 2 Solutions collect form web for “IE7 & IE8 error executing function with ajax”

    It seems to be a problem with using the browser’s domNode.innerHTML impelementation for incoming AJAX content. There’s a plugin (innerShiv) that supposedly fixes the issue. (Full disclosure, I’ve never tried the plugin.)

    And according to the plugin’s homepage, the issue is fixed in jQuery 1.7, so you might try updating your jQuery reference instead.

    Was a problem with the html5media plugin.