JavaScript 知识点总结

1.获取iframe父窗口的dom节点

parent.$("#id");
$('#父窗口中元素的id', parent.document).事件(); 

window.parent.document.getElementById("父窗口中元素的id").事件(); //js

2.获取iframe子窗口的dom节点

$("#iframe的id").contents().find("#iframe中控件的id").事件();
$("#iframe中控件的id",document.frames("iframe的name").document).事情();

window.frames["iframe中的name值"].document.getElementById("iframe中控件的id").事件();//js


猜你喜欢

转载自blog.51cto.com/dd118/2138573