以下代码在我升级到 Windows 8.1 / Internet Explorer 11 之前运行良好,现在抛出错误:“无法获取未定义或空引用的属性‘createRange’”
var SelectedData = window.external.menuArguments.document.selection.createRange().text;
是否有解决方案/解决方法?
*下面更新了问题,更新的代码仍然无法正常工作....
<html><head><title>-</title><script type="text/JScript">
function Launch()
{
var TheSelection = document.getSelection();
if(TheSelection != null)
{
.... do a bunch of stuff
}
window.close();
}
</script></head><body onload="Launch();" </body></html>
我也试过 window.getselection; window.getselection(); window.getselection().tostring();
这些似乎都不起作用......???