1.关于操作iframe中的窗口:一些例子代码:
contentWindow属性是指指定的frame或者iframe所在的window对象,在IE中iframe或者frame的contentWindow属性可以省略,但在Firefox中如果要对iframe对象进行编辑则必须指定contentWindow属性。
如iframe的id为ifrtest,要调用其页面中的b()方法:document.getEelemntById(“ifrtest”).contentWindow.b();
如父页面获取iframe页面里面的id为kxcl_type的value值:
document.getElementById("iframe").contentWindow.document.getElementById("kxcl_type").value
document.getElementsByTagName('iframe')[0].contentWindow.location.href = '/sfytj/dist/html/common/xzfy.html';
想要在iframe中写html吗?
----$("iframe").contents().find("body").html(....) 然后进行处理
2.关于jquery选择元素的一些:
$("#calendarDay li:first")
--选出id为calendarDay元素下面子元素li标签,并且是第一个li标签;
p=$("#calendarDay a:not(.none):last")
--选出id=calendarDay的元素下 子元素a标签 中class不等于none的 最后一个子元素
$("#thisone").children("a.current")
--选出id为thisone元素下面第一级child,并且标签为a,class为current的元素。