jQuery Error 80020101: A fix

I ran into the annoying Could not complete the operation due to error 80020101 bug today. I clearly am not the only one (Google: Could not complete the operation due to error 80020101). This was an old bug in jQuery that was squashed and apparently is back in jQuery 1.7.2 except it isn’t back.
The original bug was related to HTML comments. This was not the cause in my case. It was a query string variable. The fix is simple, take out the query string from the URL.

Change it from this

/Reports.aspx?ReportID=24

to this

/Reports.aspx

EDIT: Alternate Solution

Bruno commented below he this fix was not applicable in his situation. In his case, he needs the querystring. To that end, here is a way to eliminate the issue with a little bit of JavaScript.

You can leave the query string intact and remove it from the webservice URL before making the webservice call with a little bit of javascript. Before calling the webservice, use the following JavaScript to clean the URL and prevent the error

var url = window.location.href.replace(window.location.search, '');

Voilà!
No more Could not complete the operation due to error 80020101

About these ads
  1. #1 by Bruno on July 10, 2012 - 10:14 pm

    this not fix any issue if i need this query string…!

    • #2 by senseicris on July 18, 2012 - 11:42 am

      Good point. Another fix is to remove the query string from the URL using JavaScript before using the URL. I will updated the code sample to show how this can be accomplished.

  2. #3 by pod zastaw on April 30, 2013 - 10:05 pm

    I have to thank you for the efforts you have put in penning this site.
    I am hoping to view the same high-grade content from you in the future as well.

    In truth, your creative writing abilities has motivated me to get my own site
    now ;)

  3. #4 by laser spine institute on June 23, 2013 - 9:37 am

    I get pleasure from, result in I discovered exactly what I used to be taking a look for.
    You have ended my four day long hunt! God Bless
    you man. Have a great day. Bye

  4. #5 by goi on July 5, 2013 - 12:18 am

    may i see the updated sample code in removing query string from the url?

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s