javascript制作下拉弹出式菜单?为什么我的脚本在IE6下没有反映呢?急,在线等

来源:百度知道 编辑:UC知道 时间:2024/06/15 14:24:05
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>无标题文档</title>
<script language="javascript">
<!--
startList=function(){
if (document.all&&document.getElementById){
navRoot=document.getElementById("nav");
for(i=0;i<navRoot.childNodes.length; i++){
node=navRoot.childNodes[i];
if(node.nodeName=="li"){
node.onmouseover=function(){
this.className+=" over";

if (document.all&&document.getElementById){

这句太搞笑了,
删了

这种问题一般都是浏览器不支持相应的方法
可以先做一下浏览器的判断
然后在获取数据