以下是我的JS代码,如果//document.writeln(l);得注释去掉,则创建的station2和block都能看得到,但是是在新的页面上,原来的页面不见了,如果加上注释,则新建的层看不到,请问这是为什么啊?
block.style.setAttribute("z-index","150");的z-index我试了各种情况都不行,估计不是这里的问题
function InitLoad()
{
    var l =  "<div id='station2' style='height:100px; left:100px;'><img src='一级站.bmp'/></div>";
    //document.writeln(l); //创建拖动框元素
var block = document.createElement('div');
block.style.setAttribute("z-index","150");
//添加到DOM树
document.body.appendChild(block);
//设置拖动框样式
with(block.style){
//设置定位方式为绝对定位
position = 'absolute';

//设置大小溢出处理
overflow = 'hidden';

//设置初始大小
width = 500;
height = 500;

//设置边框样式
border = '1px solid #3C85E8';
//background = '#CEE0F9';
background = '#000000';

opacity = 0.3;
filter = 'Alpha(Opacity=30)';

//改变隐藏为可见
display = 'block';
}
}