Could not complete the operation due to error 800a

2019-04-06 14:27发布

What does this error mean in IE10/11:

Error: Could not complete the operation due to error 800a025e. 

And how would I debug it?

It says its this line:

this.nativeSelection.removeAllRanges();

https://code.google.com/p/rangy/source/browse/trunk/src/js/core/wrappedselection.js#416

See it in action here: http://panmedia.github.io/raptor-editor/tests/cases/selection/selection-expand.html

3条回答
可以哭但决不认输i
2楼-- · 2019-04-06 15:07

I had this error coming up recently, I fixed it with the following chceck:

var sel = window.document.getSelection();
if (sel.rangeCount > 0 && sel.getRangeAt(0).getClientRects().length > 0) {
    sel.removeAllRanges();
}
查看更多
狗以群分
3楼-- · 2019-04-06 15:10

I got this error when trying to window.getSelection().removeAllRanges(); and there was no selection. One workaround is to check if there is a selection first:

if (window.getSelection().getRangeAt(0).getClientRects.length > 0) {
    window.getSelection().removeAllRanges();
}
查看更多
Deceive 欺骗
4楼-- · 2019-04-06 15:24

All the error 80020101 means is that there was an error, of some sort, while evaluating JavaScript. If you load that JavaScript via Ajax, the evaluation process is particularly strict.

Could not complete the operation due to error 80020101. IE

查看更多
登录 后发表回答