views:

78

answers:

1

I'm using the following code to call in some html, and display it. Most browsers seem to handle it fine, but IE6 and 7 freeze up. Unfortunately, the request can sometimes take more than a few seconds, so the delay is noticeable.

I'm also calling Fancybox on success, so that the returned html can have a link that launches a modal window.

Code:

$.ajax({
      url: 'url',
      success: function(data) {
        $('#videolink').hide();
        $('#videolink').html(data).slideDown();
        $("a#video").fancybox({
           'hideOnContentClick': false,
           'transitionIn'       : 'elastic',
            'transitionOut'     : 'fade',
            'titleShow'         : false,
            'scrolling'         : 'no',
            'onStart': function() { _gaq.push(['_trackEvent', 'Event Title', 'Value']); },
           'callbackOnClose': function() { $("#fancy_content").empty();}
        });
      }
    });

Is this the best way to handle the request?

+1  A: 

Is your iexplore process using 100% CPU? If yes, then the problem is with slow DOM manipulation by IE. Try commenting out lines in success callback to check if you can find the offending one...

Jakub Konecki
I'll give this a go. Thanks for the tip!
Don H