Illegal operation on WrappedNative prototype object

一曲冷凌霜 提交于 2019-11-29 13:34:11

That error message typically refers to when you try to wrap a native function like for instance "eval"

If you do something like this -



(function() {

   var t = eval;

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

}();

Firefox won't allow you to use eval anymore because the function signature no longer matches it's internal reference point and it considers this a devious tactic. I think it's completely stupid and violates the very premise of javascript's flexibility, but it's what we now have to deal with.

Same goes for something like var x = document.createElement; calling x('div') will make firefox whine like an emo teen.

My guess 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 you mention that you tried the call without the success block and you still saw the message but maybe you could try again with an empty success function to confirm.

I'd check out what's going on in displayResult and loadXMLDoc - and I believe the illegal operation safety checks were recently added to FireFox so if you can try an older version like 3.0 you might confirm this distinction.

Otherwise I don't see anything glaring with the code you provided and sending xml data is completely valid with ajax.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!