日期:2014-05-16  浏览次数:20489 次

为什么这段JavaScript程序 IE老说有问题
JScript code
程序如下 
其中FrmInfor是一个表单, 
LyrMoveFg和LyrMoveBg是两个Div层. 
Txt起头的是文本框. 
问一下为什么有错??? 
--> 

<script language="JavaScript"> 
<!-- 
function show() 
{ 
//standard information 
document.FrmInfor.ImgBg.src=document.FrmInfor.TxtBgSrc.value; 
document.FrmInfor.ImgBg.width=document.FrmInfor.TxtBgWidth.value; 
document.FrmInfor.ImgBg.height=document.FrmInfor.TxtBgHeight.value; 
document.FrmInfor.ImgFg.src=document.FrmInfor.TxtFgSrc.value; 
document.FrmInfor.ImgFg.width=document.FrmInfor.TxtFgWidth.value; 
document.FrmInfor.ImgFg.height=document.FrmInfor.TxtFgHeight.value; 
//extended information 
var LyrMoveFg=document.getElementbyId(LyrFg); 
var LyrMoveBg=document.getElementbyId(LyrBg); 
LyrMoveFg.hspace=document.FrmInfor.TxtFgLeft.value; 
LyrMoveFg.vspace=document.FrmInfor.TxtFgTop.value; 
LyrMoveBg.hspace=document.FrmInfor.TxtBgLeft.value; 
LyrMoveBg.vspace=document.FrmInfor.TxtBgTop.value; 
} 
//--> 
</script>
问题补充:<下面的也不行呀,怎么办> 

<script language="JavaScript"> 
<!-- 
function show() 
{ 
//standard information 
document.FrmInfor.ImgBg.src=document.FrmInfor.TxtBgSrc.value; 
document.FrmInfor.ImgBg.width=document.FrmInfor.TxtBgWidth.value; 
document.FrmInfor.ImgBg.height=document.FrmInfor.TxtBgHeight.value; 
document.FrmInfor.ImgFg.src=document.FrmInfor.TxtFgSrc.value; 
document.FrmInfor.ImgFg.width=document.FrmInfor.TxtFgWidth.value; 
document.FrmInfor.ImgFg.height=document.FrmInfor.TxtFgHeight.value; 
//extended information 
var LyrMoveFg=document.getElementbyId(LyrFg); 
var LyrMoveBg=document.getElementbyId(LyrBg); 
LyrMoveFg.style.left=document.FrmInfor.TxtFgLeft.value; 
LyrMoveFg.style.top=document.FrmInfor.TxtFgTop.value; 
LyrMoveBg.style.left=document.FrmInfor.TxtBgLeft.value; 
LyrMoveBg.style.top=document.FrmInfor.TxtBgTop.value; 
} 
//--> 
</script>


------解决方案--------------------
getElementbyId
大小写
getElementById