jquery - 具有指定jsonpCallback的jQuery 1.4.2 $ .ajax使IE6/7崩溃

标签 jquery crash jsonp internet-explorer-6 internet-explorer-7

我在here之前发布了一个类似的线程,但是在进一步调查之后,我发现问题出在$ .ajax jsonpCallback参数上。

在下面的简单代码中,它每次在第二个请求时崩溃(缓存问题?)

<html>
<head>
 <title>Hello world</title>
</head>
<body>
 <span id="ClickMe">Click Me</span>
</body>
<script src="http://code.jquery.com/jquery-1.4.2.min.js" type="text/javascript"></script>
<script type="text/javascript">
 $(document).ready( function() {
  //console.log('Init');
  alert('asdasd');
  $("#ClickMe").click( function() {
   $.ajax({     
    url: 'http://URL-THAT-CAN-HANDLE-DIFFERENT-CALLBACK-NAMES',
    dataType: 'jsonp',
    jsonpCallback: 'myCustomCallback',
    success: function(data) {

    }
   });
  });

 });
</script>
</html>

此代码将导致IE6和IE7在第二次单击“单击我”跨度时崩溃。

现在有人会导致这种情况吗?

最佳答案

我不确定这是怎么回事,但是这种情况是http://code.google.com/p/jquery-jsonp/派上用场的:)

关于jquery - 具有指定jsonpCallback的jQuery 1.4.2 $ .ajax使IE6/7崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3046764/

相关文章:

ios - 应用程序在 UIPopoverPresentationController 中崩溃但没有显式弹出窗口?

ajax - 为什么我的 WCF JSONP 服务不通过 HTTPS 返回 JSONP

java - 在 Spring 中,如何从 HTTPServletResponse 对象获取 HTML 作为字符串?

javascript - 在 jQuery 中向 DataTable 添加新行时出错

python - while 循环中的 time.sleep 函数不断导致程序崩溃,解决方案还是替代方法?

jquery - MVC3 : jquery ajax to return partial view with HTML dataType from controller but getting error

ios - 显示远程通知期间应用崩溃

javascript - 什么是JSON-P,您如何发音?

javascript - 避免 var _this = this;在编写 jQuery 事件处理程序时

jquery - 我的汉堡菜单不起作用