IE6/7 Freezing during jQuery AJAX request

时光总嘲笑我的痴心妄想 提交于 2019-12-11 10:46:59

问题


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:


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...



来源:https://stackoverflow.com/questions/3757153/ie6-7-freezing-during-jquery-ajax-request

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!