最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Could not complete the operation due to error 800a025e - Stack Overflow

programmeradmin5浏览0评论

What does this error mean in IE10/11:

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

And how would I debug it?

It says its this line:

this.nativeSelection.removeAllRanges();

.js#416

See it in action here: .html

What does this error mean in IE10/11:

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

And how would I debug it?

It says its this line:

this.nativeSelection.removeAllRanges();

https://code.google./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

Share Improve this question edited Dec 15, 2015 at 19:24 Sampson 269k76 gold badges545 silver badges568 bronze badges asked Apr 23, 2013 at 4:30 PetahPetah 46.1k30 gold badges160 silver badges215 bronze badges 7
  • stackoverflow./questions/3169786/… – Ian Commented Apr 23, 2013 at 4:45
  • An example would help. – Tim Down Commented Apr 23, 2013 at 8:53
  • I'm also getting the exact same error when calling removeAllRanges() in IE9, sporadically though. @TimDown I'm thinking of using your rangy library to see if the error goes away... but first I think I'll try stackoverflow./a/3171348/227299 – Ruan Mendes Commented Feb 28, 2014 at 19:21
  • Can you provide a jsfiddle? – Dom Commented Jun 2, 2014 at 22:46
  • 3 stackoverflow./questions/22914075/… – The Alpha Commented Jun 3, 2014 at 0:38
 |  Show 2 more ments

3 Answers 3

Reset to default 4

I had this error ing 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();
}

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();
}

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 plete the operation due to error 80020101. IE

发布评论

评论列表(0)

  1. 暂无评论