IE JScript运行时错误“对象预期” [英] IE JScript Runtime Error "Object Expected"

查看:73
本文介绍了IE JScript运行时错误“对象预期”的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

WinVista / IE7

我只在IE7中遇到一些奇怪的错误,但在FF2.0.0.8或NN9中却没有。当我点击登录时,它甚至会发生在这个网站上。错误是:


发生了运行时错误。

"行:xxx"

"错误:预期的对象


和Debug说:Microsoft JScript运行时错误:预期的对象。


我的代码中的行调试指向的是:

WinVista/IE7

I am getting some weird errors only in IE7, but not in FF2.0.0.8 or NN9. It even happens on this website when I click "Sign In". The error is:

"A Runtime Error has occurred."
"Line:xxx"
"Error: Object expected"

and Debug says: "Microsoft JScript runtime error: Object expected."

The line in my code that debug points to is:

展开 | 选择 | Wrap | 行号

推荐答案


WinVista / IE7

我只在IE7中遇到一些奇怪的错误,但在FF2.0.0.8或NN9中没有。当我点击登录时,它甚至会发生在这个网站上。错误是:


发生了运行时错误。

"行:xxx"

"错误:预期的对象


和Debug说:Microsoft JScript运行时错误:预期的对象。


我的代码中的行调试指向的是:

WinVista/IE7

I am getting some weird errors only in IE7, but not in FF2.0.0.8 or NN9. It even happens on this website when I click "Sign In". The error is:

"A Runtime Error has occurred."
"Line:xxx"
"Error: Object expected"

and Debug says: "Microsoft JScript runtime error: Object expected."

The line in my code that debug points to is:

展开 | 选择 | Wrap | 行号


hi


我测试了你的函数loadDiv在Firefox和IE7中,没关系。


我认为问题是loadDiv(" divlogin);"。浏览器找不到loadDiv funcion。我认为你需要提供更多的代码。


顺便说一下,我想firefox.firefox应该有一个错误警告错误消息,错误消息将保存在错误控制台中。您可以在工具 - >错误控制台中查看。
hi

I have test your function "loadDiv" in firefox and IE7, it''s fine.

I think the problem is "loadDiv("divlogin");". the browser can''t find loadDiv funcion.I think you need to provide more code.

by the way,I guess there should have an error in firefox.firefox will not alert an error message,and the error message will be saved in "Error Console".you can check it in "tool"->"Error Console".


我已经一直在运行Firebug。在FF中根本没有报告错误。但我想我知道问题是什么。


我正在使用addEvent来启动我的外部脚本,包括我的loadDOM.js脚本,其中包含我的loadDiv()函数,以及任何addEvent调用的函数很快就找不到它。如果我等待并运行loadDiv,请使用onclick ="" attrib,它的工作原理。所以这是一个时间问题......我很快就解雇了loadDiv()命令。


所以我想我需要添加一个条件if(loadDiv)或者把我的loadDOM代码到我的loadInit.js文件中,而不是从addEvent中调用它。 Dunno,不得不考虑一下。


感谢您的回复!
I''ve been running Firebug. No errors reported in FF at all. But I think I know what the problem is.

I am using addEvent to initiate my external scripts including my loadDOM.js script, which has my loadDiv() function in it, and any function called by addEvent too soon doesn''t find it defined. If I wait and run loadDiv say with an onclick="" attrib, it works. So this is a timing issue...I''m firing off loadDiv() commands too soon.

So I suppose I need to add a conditional if(loadDiv) or put my loadDOM code into my loadInit.js file rather than call it from addEvent. Dunno, have to consider this a bit.

Thanks for your replies!


这篇关于IE JScript运行时错误“对象预期”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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