Js 可在 IE、Chrome 中运行,但不能在 Firefox 中运行
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Remote Control</title>
</head>
<link rel="stylesheet" href="/../.." type="text/css" />
<title>page title</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<SCRIPT LANGUAGE="JavaScript" SRC="popup.js" > </script> <!-- <---- Problem, doesn't work in FF but ok in IE/Chrome -->
<body>
该脚本不像在 IE 和 Chrome 上那样在 Firefox 上执行。为什么会这样?
谁能告诉我需要做什么才能让它在 FF 中工作?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>Remote Control</title>
</head>
<link rel="stylesheet" href="/../.." type="text/css" />
<title>page title</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<SCRIPT LANGUAGE="JavaScript" SRC="popup.js" > </script> <!-- <---- Problem, doesn't work in FF but ok in IE/Chrome -->
<body>
The script doesn't execute on Firefox like it does on IE and chrome. Why is this?
Could anyone tell me what needs to be done to make it work in FF?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的
popup.js
文件充满了对名为document.getelementbyid
的方法的引用。 JavaScript 中没有这样的方法,因为它是区分大小写的语言,这就是您的代码在hidep1()
函数开头处中断的原因。:替换所有出现的
getelementbyid 与 getElementById 并重试。
Your
popup.js
file is full of references to a method calleddocument.getelementbyid
. There is no such method in JavaScript because its a case-sensitive language and thats the reason your code breaks right at the beginning of thehidep1()
function.:Replace all occurrences of
getelementbyid
withgetElementById
and try again.