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?