Js工作在IE, Chrome,但不是Firefox

Js works in IE, Chrome but not Firefox

本文关键字:Firefox Chrome IE Js 工作      更新时间:2023-09-26
<!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中工作?

您的popup.js文件中充满了对称为document.getelementbyid的方法的引用。在JavaScript中没有这样的方法,因为它是一种区分大小写的语言,这就是你的代码在hidep1()函数开始时就中断的原因。

if (document.getelementbyid) {

将出现的所有getelementbyid替换为getElementById,然后重试