parent.document['uchome-ifrHtmlEditor'].insertImgLink(cur_url);window.parent.document.body.getElementById("addinfo")是什么?它接input有这么写的吗?
如果filepass有ID,直接取它的好了.

解决方案 »

  1.   

    parent.document['uchome-ifrHtmlEditor'].insertImgLink(cur_url); 
    可以这样写是马,我刚学,请问我那个有什么问题,谢谢还有为什么用input[]的形式不可以
      

  2.   

    addinfo 是一个form表单的ID 
      

  3.   

    var filepass=window.parent.document.body.getElementById("addinfo").input["filepass"].value;
    表单有input这个数组?我倒孤陋寡闻了。至少不是浏览器兼容的写法。
    为什么不把filepass给个ID:filepass
    var filepass=window.parent.document.getElementById("filepass").value;document.getElementById("uchome-ifrHtmlEditor").insertImgLink(cur_url); document.getElementById("uchome-ifrHtmlEditor")得到iframe,
    但是insertImgLink不属于iframe,而是在它的document里定义的。
      

  4.   

    谢谢朋友,解决问题了,还有个问题</head><body>
    <iframe id="HtmlEditor" src="www.baidu.com"></iframe>
    <script>
    var deditor=document.getElementById("HtmlEditor");
    alert(deditor.id);
    deditor.document.body.onclick =GetPos;
    deditor.document.body.onselect =GetPos;
    deditor.document.body.onkeyup =GetPos;
    function GetPos()
    {
      deditor.pos = deditor.document.selection.createRange();
    }</script>
    </body>
    </html>
    1,运行是deditor.document is undefined,请问是哪里错了2,我想要得到iframe中全局的焦点位置deditor.pos,请问这个可以当作全局焦点马,谢谢
      

  5.   

    iframe的source没有load完的时候它的document是不存在的。
      

  6.   

    那是不是用onload来执行,可以吗