开发者

Js works in IE, Chrome but not Firefox

开发者 https://www.devze.com 2023-03-24 16:34 出处:网络
<!DOCTYPE html> <html> <head> <meta charset=\"utf-8\" /> <title>Remote Control</title>
<!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?


Your popup.js file is full of references to a method called document.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 the hidep1() function.:

if (document.getelementbyid) {

Replace all occurrences of getelementbyid with getElementById and try again.

0

精彩评论

暂无评论...
验证码 换一张
取 消