参考帖子:HTMLayout内置behavior大全

代码示例:

import win.ui;
/*DSG{{*/
winform = ..win.form( text="HTMLayout 框架演示";bottom=399;parent=...;right=599;border="resizable" )
winform.add(
layoutWindow={ dr=1;dl=1;notify=1;right=580;left=10;dt=1;top=12;z=1;db=1;bottom=382;multiline=1;cls="edit" }
)
/*}}*/

import web.layout;
wbLayout = web.layout(winform.layoutWindow);

string.save("/frame1.html","frame1")
string.save("/frame2.html","frame2")

wbLayout.html =/***
<button>点这里加载 frame2.html</button>
<div id="main">
<iframe src="frame1.html" width="100%" height="100%">
</div>
***/

wbLayout.onButtonClick = function (ltTarget,ltEle,reason,behaviorParams) {
var ltFrame = wbLayout.queryEle("#main iframe");
ltFrame.xcall("load","frame2.html"); //加载网页到框架
}

winform.show()
win.loopMessage();