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里定义的。
谢谢朋友,解决问题了,还有个问题</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,请问这个可以当作全局焦点马,谢谢
可以这样写是马,我刚学,请问我那个有什么问题,谢谢还有为什么用input[]的形式不可以
表单有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里定义的。
<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,请问这个可以当作全局焦点马,谢谢