有没有什么好的或可靠的方法来确定JavaScript错误只使用Internet Explorer错误消息的位置? [英] Is there any good or reliable way to figure out where a JavaScript error is using only an Internet Explorer error message?

查看:120
本文介绍了有没有什么好的或可靠的方法来确定JavaScript错误只使用Internet Explorer错误消息的位置?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在编写一个应用程序,由于各种原因涉及到Internet Explorer(IE7,用于记录),ActiveX控件以及跨越多个.js的英雄数量的JavaScript。



我们的一个远程测试人员遇到错误消息,IE的错误消息说明了以下情况:

 行:719 
Char:5
错误:未指定的错误
代码:0
URL:(机器的URL)

只有一个JavaScript文件有超过719行,第719行是空行(在这种情况下)。



项目中涉及的HTML或其他文件没有719行或更多行,但是生成的HTML(它是服务器端包含的东西),在至少IE显示View Source确实有719行或更多行 - 但第719行(在这种情况下)是一个关闭表行标记(换句话说就是没有JavaScript)。



在这种情况下,查看生成的源的结果只有310行。



我可以想象,这可能是整个页面,与HTML的其余部分一起表示的JavaScript文件的内容可以在哪里错误是指的,但我不知道任何好的方式来查看将是什么,



所以,从Internet Explorer的行号是唯一的提示,但该页面实际上分散在多个文件中?



更新:事实上,遇到这种情况的用户是远程的,并且出于各种网络原因,使用Visual Studio 2008(具有令人敬畏的JavaScript调试的方式)进行调试是不可能的。我只限于让我们中的一个人来看看源码,试图找出它的代码行。



更新2:强>真正的答案(如下所接受)似乎是不,不是真的。对于什么是值得的,罗伯特·沃克关于它被关闭的一点让我指向正确的方向,因为我认为这是违规行。但是由于这并不是我所说的好或可靠(IE的错,而不是罗伯特·沃克的错误),我将接受不,不是真的的答案。我不知道这是否适合这样的礼节。如果不是通过评论,请通知我。

解决方案

简而言之。不是真的。尝试首先尝试在FF中找到错误,如果失败,您可以使用 Visual Web Developer 。调试IE大部分都很吸引人。


I'm writing an app which for various reasons involves Internet Explorer (IE7, for the record), ActiveX controls, and a heroic amount of JavaScript, which is spread across multiple .js includes.

One of our remote testers is experiencing an error message and IE's error message says something to the effect of:

Line: 719
Char: 5
Error: Unspecified Error
Code: 0
URL: (the URL of the machine)

There's only one JavaScript file which has over 719 lines and line 719 is a blank line (in this case).

None of the HTML or other files involved in the project have 719 or more lines, but the resulting HTML (it's sort of a server-side-include thing), at least as IE shows from "View Source" does have 719 or more lines - but line 719 (in this case) is a closing table row tag (no JavaScript, in other words).

The results of "View Generated Source" is only 310 lines in this case.

I would imagine that it could possibly be that the entire page, with the contents of the JavaScript files represented inline with the rest of the HTML could be where the error is referring to but I don't know any good way to view what that would be,

So, given a JavaScript error from Internet Explorer where the line number is the only hint but the page is actually spread across multiple files?

UPDATE: The issue is exacerbated by the fact that the user experiencing this is remote and for various network reasons, debugging it using something like Visual Studio 2008 (which has awesome JavaScript debugging, by the way) is impossible. I'm limited to having one of us look at the source to try and figure out what line of code it's crapping out on.

UPDATE 2: The real answer (as accepted below) seems to be "no, not really". For what it's worth though, Robert J. Walker's bit about it being off by one did get me pointed in the right direction as I think it was the offending line. But since that's not really what I'd call good or reliable (IE's fault, not Robert J. Walker's fault) I'm going to accept the "no, not really" answer. I'm not sure if this is proper SO etiquette. Please let me know if it's not via the comments.

解决方案

In short. Not really. Try finding the error in FF first, and if that fails, you can get an almost as good debugger with Visual Web Developer. Debugging IE just sucks for the most part.

这篇关于有没有什么好的或可靠的方法来确定JavaScript错误只使用Internet Explorer错误消息的位置?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆