Illegal operation on a WrappedNative object prototype

I apologize if this answer is similar to other questions on this website, but I could not find what I needed.

I have this code:

$.ajax({ url: '../../cgi-bin/executeQuery', type: 'GET', data: ({siid:5185,of:"xmlWithColID"}), dataType: 'xml', success: function(xmlR){ try{ $.ajax({ url: '../../cgi-bin/authList.py', type: 'GET', data: ({xmlToFormat:xmlR,service:"paperList"}), dataType: 'xml', success: function(data){ try{ displayResult(data,loadXMLDoc("js/authList/paperTableStyle.xsl"),"divPaperTable"); }catch(e){ console.log(e.message); } }, complete: function(XMLHttpRequest, textStatus){ $('#divMakingAuthorList').addClass('secondary'); $('#divMakingAuthorList').hide(); } }); }catch(e){ console.log(e.message); } } }); 

This gives me the following error in FF: "Illegal operation on a WrappedNative prototype object."

When I removed the β€œsuccess” part of my code, the error message was still there. After that, I deleted the "full" parte, and an error message appeared there. But then, when I deleted the following line of my code: data: ({xmlToFormat: xmlR, service: "paperList"}), the message disappeared.

But I do not understand the reason. Is it possible to send "xml" to my CGI as data in an ajax event?

thanks

+8
jquery xml ajax cgi
source share
1 answer

This error message usually refers to when you try to wrap your own function, for example, "eval"

If you do something like this -

 (function() { var t = eval; eval = function() { t.apply(window, arguments); } }(); 

Firefox won't let you use eval anymore because the function signature no longer matches its internal breakpoint, and it considers this insidious tactic. I think this is completely stupid and violates the very idea of ​​javascript flexibility, but this is what we are now faced with.

The same applies to var x = document.createElement; calling x ('div') will make firefox whine like an emo teenager.

My assumption is that when xmlR is not passed to the second ajax request, the request fails and so your success block is never called. I know that you mention that you tried the call without a success block, and you still saw the message, but maybe you can try again with an empty success function to confirm.

I would look at what happens in displayResult and loadXMLDoc, and I believe that illegal security checks have recently been added in FireFox, so if you can try an older version like 3.0, you can confirm this difference.

Otherwise, I do not see anything vivid in the code that you provided, and sending the XML data is completely correct using ajax.

+7
source share

All Articles