import win.ui; /*DSG{{*/ winform = ..win.form( bottom=399;parent=...;right=599;text="在HTMLayout中使用框架" ) /*}}*/
import web.layout; wbLayout = web.layout( winform ); wbLayout.html =/*** <iframe src="about:blank" style="width:100%%;height:100%%" /> ***/ var frame = wbLayout.queryEle("iframe"); wbLayout.onDocumentComplete = function() { frame.querySelector("input#kw").value = "测试"; } frame.xcall("load","http://www.baidu.com");
winform.show() win.loopMessage();
|
使用CSS选择器查询框架内的节点时,需首先获取框架节点。例如:
var frame = wbLayout.queryEle("iframe"); frame.querySelector("input#kw").value = "测试";
|
使用框架打开网页:
frame.xcall("load","http://www.baidu.com");
|
清空框架内容: