javascript 萤火虫错误:未找到元素

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/7386078/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-10-25 23:56:39  来源:igfitidea点击:

firebug error : no element found

javascriptxmlservlets

提问by Bibhaw

1client : send request to server via AJAX fn.

1 个客户端:通过 AJAX fn 向服务器发送请求。

2Server : response in form of text/xmland it works correctly only 1 or 2 times
response.setContentType("text/xml");

2服务器:以 的形式响应text/xml并且它只能正常工作 1 或 2 次
response.setContentType("text/xml");

3but only after 1/2 request, i get error in browser (firebug) and it says No element found

3但仅在 1/2 请求后,我在浏览器(萤火虫)中收到错误并显示No element found

client : javascript jQuery ajaxserver : java servlet

客户端:javascript jQuery ajax服务器:java servlet

can somebody give any tips to sort out.

有人可以提供任何提示来解决。

采纳答案by Quentin

can somebody give any tips to sort out.

有人可以提供任何提示来解决。

Look at the HTTP traffic. Figure out if the problem is because of a broken request or a broken response. That will tell you if you need to investigate the server side or the client side code.

查看 HTTP 流量。确定问题是由于请求中断还是响应中断造成的。这将告诉您是否需要调查服务器端或客户端代码。

回答by mimo

Setting the mimeType to "text/html" fixed it for me

将 mimeType 设置为“text/html”为我修复了它

回答by Sadiq Malik

Put a semicolon at the end of your jquery function for example I had a function

在 jquery 函数的末尾放一个分号,例如我有一个函数

$(document).on("change", "#myid", function() {})

$(document).on("change", "#myid", function() {})

changed to

变成

$(document).on("change", "#myid", function() {});

$(document).on("change", "#myid", function() {});

worked for me

对我来说有效