【发布时间】:2014-04-11 20:52:14
【问题描述】:
这个 ajax 调用使 IE11 和 css 动画冻结。 Mozilla 和 Chrome 都很好。不仅这个有问题,我把它作为一个例子。以下是我迄今为止尝试过的几种解决方法:
-禁用缓存。我从服务器禁用它。,
-尝试过 setTimeout 技巧,
-删除了嵌套函数。事件只是 .html() 方法不能单独工作。
$.ajax({type: 'POST',
url: "accordion.php?cat="+aid,
async: true,
success: function (html) {
$("#accordion").animate({ right: "140%"},500, function () {
$(this).css("right","-25%", $(this).hide(1, function() {
$(this).html(html).show(1, function() {
$(this).animate({right: "100%"},1000),$ajaxloading.fadeOut("slow")})}));});}})
【问题讨论】:
-
如果将
success函数中的函数从AJAX 中取出(使用静态html字符串),它们会冻结浏览器吗? -
其实这是一个聪明的建议,但它不会是一样的。这是一个 php ajax 发送变量。这让我很好奇它是否在 php 编写过程中挂起。但是,无论如何...我会尝试使用其他一些 html 字符串并让您知道结果。
-
function myAjax(html){$("#accordion").animate({ right: "140%"},500, function () {$(this).css("right","-25%", $(this).hide(1, function() {$(this).html(html).show(1, function() {$(this).animate({right: "100%"},1000),$loading.fadeOut("slow")})}));});} }}); htm:"<foo><bar>Do Jo</bar></foo>";myAjax(htm);这工作非常顺利。我试过一张大桌子,没有问题。我在手风琴.php 中链接了其他一些.js 文件。可能是因为 IE 正在尝试初始化这些脚本。 -
看起来还是很奇怪。另一个测试用例可能使用精确的
action.php结果作为myAjax()函数的参数,而无需再次使用AJAX (htm: "action.php output, write yourself")。如果它再次冻结,那么它不是关于 AJAX,而是我猜。 -
是的,长时间的 php 文字也会导致挂起。简而言之,js initilizing 和长时间的 php 调用导致 IE 挂起。
标签: jquery ajax internet-explorer-11