当前位置: 代码迷 >> ASP >> 求 window.parent.document.getElementById(.)为空或不是对象的解决方法
  详细解决方案

求 window.parent.document.getElementById(.)为空或不是对象的解决方法

热度:777   发布时间:2013-06-25 23:45:42.0
求 window.parent.document.getElementById(...)为空或不是对象的解决办法。
<span id=""gname30024"&object_id&""" name=""gname30024"&object_id&"""><input tqitae=""text"" size=""5"" value="&ph&" maxlength=""20"" ?style=""border:1px solid #FFFFFF; text-align:center; ime-mode:Disabled; color:#800000; font-weight:bold;text-align:center; padding-left:4px; padding-right:4px; padding-top:1px; padding-bottom:1px; background-color:#FFFFFF; cursor:hand;"" onClick=""forder13('"&object_id&"','"&ph&"','shuisheng','ph','object_id','gname30024');""></span>
<input type=""text"" id="""&object_id&""" value="""&ph&""" readonly size=""5"">



function forder13(id,v,tablename,fname,gname,str5)
{
? ? ? ? str='<input type="text" size="5" value="'+id+'">';

? ? ? ? str2='<input id="kk'+id+'"style="text-align:center" type="text" size="5" value="'+v+'" onblur="fchangeorder13('+id+',this.value,\''+v+'\',\''+tablename+'\',\''+fname+'\',\''+gname+'\',\''+str5+'\');window.parent.document.getElementById('+id+').value=this.value;">';

? ? ? ? //alert(str2);

? ? ? ? $("#"+str5+id).html(str2); ? ? ? ? ? ? ?

? ? ? ? $("#kk"+id).focus();

? ? ? ? $("#kk"+id).select();

}
我这里可以运行, window.parent.document.getElementById('+id+')不报错。

当我这样写时报错 window.parent.document.getElementById(...)为空或不是对象,如下
<input type=""text"" id=""aa"&object_id&""" value="""&ph&""" readonly size=""5"">
window.parent.document.getElementById(aa'+id+').value=this.value;"

好多方法都试过了,如修改js属性呀,调整代码位置呀,加弹出窗口呀,都试过了,无解,求大神了!!!!

------解决方案--------------------
传递你的对象id参数到iframe页面去
  相关解决方案