在IE浏览器里面,创建div被拦截了,因为一拦截我的程序就报错,有没有好的办法啊
急啊,谢谢了
<!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=utf-8" />
<title>无标题文档</title>
</head>
<script language="javascript">
function ddd(){
popupDiv = document.createElement("div");
//给这个元素设置属性与样式
popupDiv.setAttribute("id","popupAddr")
popupDiv.style.position = "absolute";
popupDiv.style.border = "1px solid #ccc";
popupDiv.style.background="#fff";
popupDiv.style.zIndex = 99;
popupDiv.style.width="200px";
popupDiv.style.height="100px";var popObj=document.getElementById("popupAddr");
popObj.innerHTML="";
}
</script>
<body onload="ddd()">
<div id="popupAddr"></div>
</body>
</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=utf-8" />
<title>无标题文档</title>
</head>
<script language="javascript">
function ddd(){
popupDiv = document.createElement("div");
//给这个元素设置属性与样式
popupDiv.setAttribute("id","popupAddr")
popupDiv.style.position = "absolute";
popupDiv.style.border = "1px solid #ccc";
popupDiv.style.background="#fff";
popupDiv.style.zIndex = 99;
popupDiv.style.width="200px";
popupDiv.style.height="100px";var popObj=document.getElementById("popupAddr");
popObj.innerHTML="";
}
</script>
<body onload="ddd()">
<div id="popupAddr"></div>
</body>
</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=utf-8" />
<title>无标题文档</title>
</head>
<script language="javascript">
function ddd(){
popupDiv = document.createElement("div");
//给这个元素设置属性与样式
popupDiv.setAttribute("id","popupAddr")
popupDiv.style.position = "absolute";
popupDiv.style.border = "1px solid #ccc";
popupDiv.style.background="#fff";
popupDiv.style.zIndex = 99;
popupDiv.style.width="200px";
popupDiv.style.height="100px";
document.body.appendChild(popupDiv);
var popObj=document.getElementById("popupAddr");
popObj.innerHTML="111";
}
</script>
<body onload="ddd()"></body>
</html>