解决方案,参考代码!
var ifEdit = this.getElementByXid("ifEdit").contentWindow;
//编辑模式
ifEdit.document.designMode = "on";
ifEdit.document.contentEditable = true;
var GetPos = function(event){
debugger;//获取ifram中节点并操作dom元素或获取属性值!
ifEdit.pos = event.target;//ifEdit.document.selection.createRange();
};
ifEdit.document.body.onclick = GetPos;
ifEdit.document.body.onselect = GetPos;
ifEdit.document.body.onkeyup = GetPos;
评一波