ie11下,插入框架Html

if(navigator.userAgent.indexOf("MSIE")>0 || (navigator.userAgent.indexOf("Trident") > -1 && navigator.userAgent.indexOf("rv:11") > -1)){
  if(window.getSelection){
    var img = document.createElement("img");
    img.src = 'http://static.qyer.com/images/ask/temp/ask_append_img.png';
    img.className = 'js_load_pic';
    var m = editor.getSelection().getRangeAt(0);
    if(m){
      editor.document.body.appendChild(img);
    }
  }else{
  editor.document.selection.createRange().pasteHTML('<img src="http://static.qyer.com/images/ask/temp/ask_append_img.png" class="js_load_pic"/>') ;  }
}else{
  editor.document.execCommand("insertHTML", null, '<img src="http://static.qyer.com/images/ask/temp/ask_append_img.png" class="js_load_pic"/>'); 
  //插入HTML }

 

posted @ 2014-07-07 17:23  barbabravo  阅读(475)  评论(0编辑  收藏  举报