Could not convert JavaScript argument arg 0“ nsresult: ”0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS

有些话、适合烂在心里 提交于 2019-12-20 02:45:07

问题


I am trying to make this captcha jquery plugin to work. The a certain line of code is executed, the error pops up.

This is the line of code that causes the error :

$(".ajax-fc-" + rand).draggable({ containment: '#ajax-fc-content' });

What I am assuming is that there is some kind of conflict with the javascript reference, but can't determain what.

These are the referenes that I am using

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>

<script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.7.2/jquery-ui.min.js"></script>
<script src="js/ui.core.js"></script>
<script src="js/ui.draggable.js"></script>
<script src="js/ui.droppable.js"></script>
<script src="js/effects.core.js"></script>
<script src="js/effects.slide.js"></script>

回答1:


As per RaYell's indirect suggestion the problem was i was returning the wrong value in the ajax response.




回答2:


Ran into the same problem and it was driving me nuts. Make sure you are passing in the correct objects types to their functions. I accidentally passed in an structure when it was expecting a string.

This would error:

var COUNTRY_CODE = $(aform.COUNTRY_CODE);
$.post("/cfcs/reports/reports.cfc?method=getRegions",
            {COUNTRY_CODE:COUNTRY_CODE}, function(resp) { ...

The solution is to add .val(), as shown below:

var COUNTRY_CODE = $(aform.COUNTRY_CODE);
$.post("/cfcs/reports/reports.cfc?method=getRegions",
           {COUNTRY_CODE:COUNTRY_CODE.val()}, function(resp) { ...
                                     ^^^^^^



回答3:


Add Dojo to the list. I'm Having the same problem with the Dojo Toolkit framework. (Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.2.10) Gecko/20100915 Ubuntu/9.10 (karmic) Firefox/3.6.10 GTB7.1)

Chrome and Opera work with my code just fine, yet my new update to Linux FireFox gave the same error --> nsresult: ”0x80570009 (NS_ERROR_XPC_BAD_CONVERT_JS). I to am doing some positioning of hidden elements as one of the links above describes.




回答4:


Ooops. My bad. I found the problem. Apparently my new install of FF was picker about a mis-assigned object function. Chrome, Opera and previous FF had no problem with the the essentially "null" function, while the new version did. They just ignored it, so I never knew is wasn't right in the first place.




回答5:


Just place the Draggable Jquery Reference before Core Jquery reference




回答6:


This seems to work: "jQuery Firefox error: Could not convert JavaScript argument arg 0 [nsIDOMViewCSS.getComputedStyle]"

https://siderite.dev/blog/jquery-firefox-error-could-not-convert.html




回答7:


I am using this method to make jQuery work with jQuery and prototype + scriptaculous: http://api.jquery.com/jQuery.noConflict/



来源:https://stackoverflow.com/questions/1326896/could-not-convert-javascript-argument-arg-0-nsresult-0x80570009-ns-error-xpc

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