“预期的对象” IE中出错,但Firefox或Opera没有错误 [英] "Object Expected" error in IE, but no error in Firefox or Opera

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

问题描述

当我加载页面

< https://bugzilla.mozilla.org/attachment.cgi?id = 237739 with Internet

Explorer 7 RC 1,I得到错误对象预期当我点击按钮时,我在第186行也得到了相同的错误。同样的

HTML和JavaScript在Firefox和Opera中完美运行。如何在IE中使用代码?

When I load the page
<https://bugzilla.mozilla.org/attachment.cgi?id=237739with Internet
Explorer 7 RC 1, I get the error "Object Expected" at line 174. When I
click on the button, I also get the same error on line 186. This same
HTML and JavaScript works perfectly in Firefox and Opera. How can I make
the code work in IE?

推荐答案



Steve Chapel写道:

Steve Chapel wrote:

当我加载页面时

< https://bugzilla.mozilla.org/attachment.cgi?id = 237739with Internet

Explorer 7 RC 1,我收到错误Object Expected当我点击按钮时,我在第186行也得到了相同的错误。同样的

HTML和JavaScript在Firefox和Opera中完美运行。如何才能使代码在IE中运行?

When I load the page
<https://bugzilla.mozilla.org/attachment.cgi?id=237739with Internet
Explorer 7 RC 1, I get the error "Object Expected" at line 174. When I
click on the button, I also get the same error on line 186. This same
HTML and JavaScript works perfectly in Firefox and Opera. How can
I make the code work in IE?



开头的SCRIPT标签使用TYPE属性: -


type =" application / javascript"


- IE根本不支持。因此,SCRIPT元素'

的内容不会被处理,它包含的所有函数都不会定义为
。有些对象是预期的。


只有将TYPE属性的值更改为IE才能识别(或完全删除)允许代码在IE上运行。


Richard。

The opening SCRIPT tag uses the TYPE attribute:-

type="application/javascript"

- which is not supported by IE at all. As a result the SCRIPT element''s
contents are not processed and all the functions it contains are never
defined. There are the objects that are "expected".

Only changing the value of the TYPE attribute to something IE will
recognise (or removing it entirely) would allow the code to run on IE.

Richard.


Richard Cornford写道:
Richard Cornford wrote:

开头的SCRIPT标签使用TYPE属性: -


type =" application / javascript"


- IE根本不支持。因此,SCRIPT元素'

的内容不会被处理,它包含的所有函数都不会定义为
。有些对象是预期的。


只有将TYPE属性的值更改为IE才能识别(或完全删除)将允许代码在IE上运行。
The opening SCRIPT tag uses the TYPE attribute:-

type="application/javascript"

- which is not supported by IE at all. As a result the SCRIPT element''s
contents are not processed and all the functions it contains are never
defined. There are the objects that are "expected".

Only changing the value of the TYPE attribute to something IE will
recognise (or removing it entirely) would allow the code to run on IE.



你是对的。将其更改为type =" text / javascript"作品。谢谢!


是否有适用于所有浏览器的IETF标准MIME类型?

是的,我*是一个绝望的乐观主义者!

You''re right. Changing it to type="text/javascript" works. Thanks!

Is there any IETF standard MIME type that will work across all browsers?
Yes, I *am* a hopeless optimist!


Steve Chapel写道:
Steve Chapel wrote:

Richard Cornford写道:
Richard Cornford wrote:

开头的SCRIPT标签使用TYPE属性: -


type =" application / javascript"


- IE不支持一点都不因此,SCRIPT元素'

的内容不会被处理,它包含的所有函数都不会定义为
。有些对象是预期的。


只有将TYPE属性的值更改为IE才能识别(或完全删除)将允许代码在IE上运行。
The opening SCRIPT tag uses the TYPE attribute:-

type="application/javascript"

- which is not supported by IE at all. As a result the SCRIPT element''s
contents are not processed and all the functions it contains are never
defined. There are the objects that are "expected".

Only changing the value of the TYPE attribute to something IE will
recognise (or removing it entirely) would allow the code to run on IE.



你是对的。将其更改为type =" text / javascript"作品。谢谢!


是否有适用于所有浏览器的IETF标准MIME类型?

是的,我*是一个绝望的乐观主义者!


You''re right. Changing it to type="text/javascript" works. Thanks!

Is there any IETF standard MIME type that will work across all browsers?
Yes, I *am* a hopeless optimist!



是text / javascript。浏览器要么太老了要么无法附加含义,所以忽略它默认为javascript,或者他们认为它是/ b $ b意味着javascript。

Richard。

Yes "text/javascript". Browsers are either too old to attach meaning to
it, and so ignore it defaulting to javascript, or they assume it to
mean javascript.

Richard.


这篇关于“预期的对象” IE中出错,但Firefox或Opera没有错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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