本文转自:http://bbs.blueidea.com/archiver/tid-2804690.html
原文如下:
我的代码如下
document.getElementById("news").background = "images/news_bg3.gif";
IE可以正常运行
firefox却不行,请高手帮忙解决
[html]
<!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 type="text/javascript">
function bg(){
document.getElementById("news").style.backgroundImage = "url(http://bbs.blueidea.com/images/blue/logo.gif)";
}
</script>
</head>
<body οnlοad="bg()">
<div id=news>
asfafdf
</div>
</body>
</html>
[/html]