百度ueditor的dialog弹出层方式为,创建一个 iframe,在 iframe 里打开一个 html 页面,因此问题转化为:如何从 iframe 中获取表单内容
- 根据iframe的id属性,获取window;
- 即可使用 window.document.getElementById(“id”);
代码如下:
$({
var window = fGetWindow("iframeId");
var val = fGetVal(window, "elementId");
});
function fGetWindow(iframeId) {
return $(document.getElementById(iframeId).contentWindow)[0];
}
function fGetVal