在WrappedNative原型对象非法操作 [英] Illegal operation on WrappedNative prototype object

查看:257
本文介绍了在WrappedNative原型对象非法操作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

对不起,如果这个答案似乎类似于本网站的其他问题, 但我无法找到我所需要的。

I'm sorry if this answer seems similar to other questions in this website, but I couldn't find what I need.

我有这个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);
                    }
            }
    });

这让我在FF下面的错误:非法操作上WrappedNative原型对象

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

当我删除了我的code成功的一部分,该错误信息仍然存在。 之后,我删除了完整的片面和错误消息也在那里。 但是,当我删除了我的code以下行:     数据:({xmlToFormat:xmlR,服务:paperList}), 该消息已经走了。

When I removed the "success" part of my code, the error message was still there. After, I removed the "complete" parte and the error message was there too. But then, when I removed the following line of my code: data: ({xmlToFormat:xmlR,service:"paperList"}), The message was gone.

但我不明白其中的道理。是否可以发送XML以我的CGI数据在Ajax事件?

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

感谢

推荐答案

这是错误信息通常是指当您尝试包像一个原生功能,比如EVAL

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将不会允许你使用eval了,因为函数签名不再匹配它的内部参考点,并认为这是一个迂回战术。我认为这是完全愚蠢的,违反了JavaScript的灵活性非常premise,但是这是我们现在要处理的。

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.

也是一样的类似变种X = document.createElement方法;调用X('格')将使Firefox的抱怨像一个情绪的青少年。

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

我的猜测是,当xmlR不传递给第二个Ajax请求的请求失败,因此您的成功不调用这个块。我知道你提到你尝试没有成功的模块调用,你还看到了消息,但也许你可以用一个空的成功,函数尝试再次确认。

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.

我想看看发生了什么事情在displayResult和loadXMLDoc - 我相信非法操作的安全检查,最近添加到Firefox,所以如果你可以尝试像3.0的旧版本,你可能会确认这种区别

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.

否则,我没有看到任何明显的与你提供的code和发送XML数据完全与阿贾克斯有效。

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

这篇关于在WrappedNative原型对象非法操作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆