发现可以使用:
var focusedWindow = document.commandDispatcher.focusedWindow;
var sel = focusedWindow.getSelection.call(focusedWindow);
来代替document.getSelection(); 以防止出现一个提示,说这个方法已经弃用了。
这中间又有一点手误导致原来的Document 变成了dcument Eement, 代码不执行,也没有错误提示。
而且window.getSelection和Document的getSelection的返回值不一样,必须显示的调用.toString方法才能对它进行一些字符串的操作。
Tuesday, June 20, 2006
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment