简体   繁体   English

JavaScript函数命名问题Opera与IE11“ start()”

[英]JavaScript function naming issue Opera vs. IE11 “start()”

I'm having some trouble with this line of code in my HTML : 我在HTML这一行代码遇到了一些麻烦:

<input type="button" class="someClass" id="myId" onclick="start()" value="Begin">

In Opera 17 everything works fine, in Internet Explorer 11 I need to rename the onclick function to: Opera 17中,一切正常,在Internet Explorer 11中,我需要将onclick function重命名为:

... onclick="startX()" ...

or some other name, but I'm not allowed to use start() , why is this so ? 或其他名称,但不允许使用start() ,为什么会这样? And what does the function start() do in IE11 ? IE11中, function start()作用是什么?

Thanks to Frédéric Hamidi I did some research about the element and I can confirm that the method .start() and also .stop() belongs to it. 感谢FrédéricHamidi,我对元素进行了一些研究,可以确认方法.start()和.stop()都属于该方法。

Source: marquee tutorial 来源: 跑马灯教程

PS: the element is deprecated. PS:元素已弃用。

Windows has confusion with certain historic baggage it carries from DOS days. Windows从DOS时代开始就对某些历史性的行李感到困惑。 For example you cannot name a file/folder as con is a reserved device name from the DOS era. 例如,您不能命名文件/文件夹,因为con是DOS时代的保留设备名称。 On the same lines, start is a DOS batch scripting command. 在同一行上, start是DOS批处理脚本命令。 I believe that is the reason why IE does not like Javascript function named start . 我相信这就是IE不喜欢名为start Javascript函数的原因。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM