如何解决javascript运行时错误? [英] How to solve the javascript runtime error?

查看:106
本文介绍了如何解决javascript运行时错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我在做一个项目。我收到了JavaScript运行时错误。错误是:

Hi,

I m working on a project. I am receiving a JavaScript runtime error. The Error is:

Microsoft JScript runtime error: Sys.ArgumentNullException: Value cannot be null.<br />
Parameter name: element





请帮我解决这个错误。

谢谢。



Please help me solve this error.
Thank you.

推荐答案

这是Microsoft Ajax Library中一个非常常见的例外,只是意味着你有一些名为错误的东西或者你缺少一个参数。有时您可能只是将错误的元素ID设置为某个参数,这将抛出异常。



您需要发布代码以便我们可以看到如果您的标记中有任何错误。异常消息本身是如此通用,它并没有真正告诉我们很多正在发生的事情。
This is a very common exception in the Microsoft Ajax Library, and just means you've got something named wrong or you are missing a parameter. Sometimes you might just have the wrong element id set somewhere as a parameter, and this will throw the exception.

You'll need to post your code so we can see if there are any errors in your markup. The exception message itself is so generic it doesn't really tell us alot about what is going on.


你的一些元素的值为null。您需要调试代码以找出哪个元素值为null。



在使用元素值执行任何操作之前,最好进行空检查。
Value of some of your element is null. You need to debug your code to find out which element value is null.

Better do a null check before doing any operation with the elements value.


看起来你缺少一个参数,或者可能是控件(你正在使用的)的ID在运行时发生变化,这就是为什么这些控件在运行时不可用。
it is looking like you are missing a parameter or may be the IDs of the controls (which you are using) is changing on run time, thats why these controls are not available on run time.


这篇关于如何解决javascript运行时错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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