1. 程式人生 > >JavaScript 知識點總結

JavaScript 知識點總結

lba bsp window parent asc als ram mes 事情

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


JavaScript 知識點總結