解决方案 »

  1.   

    obj.blur();//没有这行 document.selection.createRange().text会报错这行去掉。我这没报错,去掉这一行在iframe里面也能正常返回路径。
      

  2.   

    问题已经解决。在另外一个帖子中找到答案。使用:window.top.document.body.focus();
     if (window.navigator.userAgent.indexOf("MSIE")>=1)  
          {  
            obj.select(); 
            //obj.blur();
            /**obj.blur();没有这行 document.selection.createRange().text会报错。
            有这行当本页面作为子页面导致document.selection.createRange().text为空*/
            //解决作为子页面,在父亲页面上导致document.selection.createRange().text获取值为空的问题
            window.top.document.body.focus();
          return document.selection.createRange().text;  
          }