Jquery Code块在多次调用中被忽略几次 [英] Jquery Code chunk getting ignored few times in multiple calls
问题描述
我一直在开发一个单页面Web应用程序,它主要针对基于这些AJAX请求响应的Web方法和DOM操作的AJAX请求。
我有我遇到了一个奇怪的问题,而不是单一的ajax请求,当我得到一个成功的回复和
I have been developing a single page web application which works mainly on AJAX requests to web methods and DOM Manipulation based on responses of those AJAX requests.
I have been facing the strange problem than on a single ajax request, When i got a success response and
success: function (response) {
}
chunk也被调用。但是在成功块内部,一块块被忽略了。意思是不叫。并且我使用警报测试了它,如下所示。
chunk been called as well. but inside the success block a piece of chunk is got ignored. mean not called. and I tested it using alerts as well like below.
success: function (response) {
alert(response); // it always called.
malfunctioning chunk
{
alert(""); // it called some times and sometimes not.
}
}
更进一步。让我清楚一下有问题的代码在实际中做了什么。
它只是使用
while to further extent. let me clear what problematic code is doing in actual.
Its just parsing the response.d using
$.parseJSON
解析响应而不是遍历数组来创建要附加到另一个元素的HTML。
明显的事情:当我使用浏览器的调试器时,有问题的代码开始工作。
任何人都可以告诉我如何摆脱这个???
and than traversing the array to create a HTML to be appended to another element.
STRANGE THING: that problematic code starts working always when i used the debugger of browser.
Anybody can give me idea of how to get rid of this ???
推荐答案
.parseJSON
.parseJSON
并且遍历数组以创建要附加到另一个元素的HTML。
奇怪的是:当我使用浏览器的调试器时,有问题的代码开始工作。
任何人都可以告诉我如何摆脱这个???
and than traversing the array to create a HTML to be appended to another element.
STRANGE THING: that problematic code starts working always when i used the debugger of browser.
Anybody can give me idea of how to get rid of this ???
这篇关于Jquery Code块在多次调用中被忽略几次的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!