Ajax with error error 80020101 when returning a string from a request

I get the following error from executing my code: Microsoft JScript runtime error : The operation failed to complete due to error 80020101.

The following link is what I found in Stackoverflow: Problem with Ajax request: error 80020101

var div = $("<div class='modal'>").html($(result.getWebFormDesignFieldContentsResult)); 

Passed in the information, result.getWebFormDesignFieldContentsResult is a long string of HTML and JAVASCRIPT that is not yet parsed in the DOM. I just find it strange since I worked on it the other day and then tried to add additional functionality ... breaking it. :(

The string passed in is quite large, but there is something like:

 <div>input tags for filtering</div> <select><option></option>...[150 option tags]... </select> <anchor tag to return contents> <script type = "text/javascript"> ...stuff fires related to the above items... </script> 

I thought that he was having a problem with passing information passed as a string to be placed in a div tag, since it CANNOT look like script tags.

Has anyone else done this or what should I give some guidance on how to handle this? Maybe I want to create a string object and then break the contents accordingly and place the html in html only and then process the js in a different style.

Result String (result.getWebFormDesignFieldContentsResult)

You can also visit here: http://jsfiddle.net/3kFv2/

  <table style='width:inherit;'> <tr> <td> <input type='text' id ='queryInput' onkeypress = 'clearTimeout(timerVar); timerVar = setTimeout(function(){ fetchFieldInfo($("#queryInput").val()); },1000);' /> </td> <td style = 'text-align:right;'> <a class = 'modalButton' id = 'queryButton' runat='server' value = 'Re-Filter' onCLick = '$("div.modal").fadeOut(); fetchFieldInfo($("#queryInput").val());'>Re-Filter</a> </td> </tr> <tr> <td colspan='2' style='margin-left:auto; margin-right:auto; text-align:center;'><select size = '20' id = 'selectList' name = 'selectList' ><option value = '1000'>Abutment Notes</option><option value = '2300'>Abutments Notes</option><option value = '2302'>Abutments Notes Maint Need</option><option value = '2301'>Abutments Notes Remarks</option><option value = '10942'>Concrete Deterioration Maint Need</option></select></td> <td> <div style='width:300px;height:300px;' id = 'modalInfoPanel'> </div> </td> </tr> <tr> <td></td> <td style='text-align:right;'> <a class = 'modalButton' id = 'buttonReturnValue' value = 'Return Selected Element' onClick='$("div.modal, div.overlay").fadeOut();'>Return Selected Element</a> </td> </tr> </table> <script type = 'text/javascript'> function ajaxDisplayContents(value){ //alert(value.val()); /* $('#selectList option').each(function(){ return $(this).val() == ''; }).attr('selected','selected'); */ $.ajax({ type: 'POST', url: WEBSERVICE_URL + '/fetchFieldInfo', dataType: 'json', contentType: 'application/json', data: JSON.stringify({'fe_id': value.val().toString()}), success: function(result, textStatus, jqXHR){ $('#modalInfoPanel').html(result.fetchFieldInfoResult); }, error: function(xhr, status, message){ $('#modalInfoPanel').html(status + ' ' + message); } }); } $('select#selectList').change(function(){ ajaxDisplayContents($(this)); }); $(function(){ $('ul li').click(function(){ clicker(this); }); }); function clicker(x){ if($(x).next().is('li') || $(x).next().length == 0){ $.ajax({ type: 'POST', url:, dataType: 'json', contentType: 'application/json', data: JSON.stringify({}), success: function(result){ $(x).after($('<ul>').append($(result['METHODResult'])); $(x).next().find('li').click(function() clicker(this); }); }, error: function(){ alert('failed to fetch'); } }); }else if($(x).next().is('ul')){ $(x).next().slideUp(function(){ $(this).remove(); }); } } </script> 
+4
source share
3 answers

Looking at: http://mattwhite.me/blog/2010/4/21/tracking-down-error-80020101-in-internet-exploder.html reports that although there are fundamentally errors like built-in script tags and etc ...., the error simply indicates "There is an error."

After taking this information into my heart, I delved into my code to find more and more questions, commenting on fragments here and there. The error I encountered is ajax call for clicker (). I looked at him for a second and realized that the original ajax call was commented out. This is a new web service call, not implemented and having errors. Since I commented on this, it works like normal again, I just need to determine everything correctly for this ajax call, and everything will be fine.

I thank you all for your help in debugging. :)

+3
source

I got the same error 80020101.

Then, checking the code line by line, I realized that I added this twice by mistake: <script<script>

As soon as I deleted them, the error disappeared.

So double check all your code, especially to open tags that are not closed properly.

+4
source

In my case, the problem was special characters (accents) that were located at the end of some lines of the comment.

When these characters are close to the end of the comment line, Internet Explorer removes some of them (including the newline character) and breaks the JavaScript code.

 // This comment line could fail because it has an accent at the end aeíou alert("This line probably doesn't work in IE"); 

IE will understand this line as:

 // This comment line could fail because it has an accent at the end **aealert**("This line probably doesn't work in IE"); 

Hope this helps you.

0
source

All Articles