You need to sign in to do that
Don't have an account?
Shin
prototype.js and AJAX Toolkit causes error
While creating AJAX Toolkit apps I encountered an unexpected error, saying
Code:
uncaught exception: {faultcode:'soapenv:Client', faultstring:'Attribute "xmlns" bound to namespace "http://www.w3.org/2000/xmlns/" was already specified for element "query".', }After long time debugging I finally found out following two libraries are conflicting, prototype.js and AJAX Toolkit. This simple S-Control would raise same error message.
Code:
<html> <head> <script type="text/javascript" src="/soap/ajax/8.0/connection.js"></script> <script type="text/javascript" src="http://prototypejs.org/assets/2007/1/18/prototype.js"></script> <script type="text/javascript"> window.onload = function() { var res = sforce.connection.query('SELECT count() FROM Account', function(res) { alert(res.size) }) } </script> </head> <body> </body> </html>It appears that some array prototype overiding in prototype.js causes this problem. Now prototype.js is one of the most major JavaScript library, do you have any workaround from AJAX Toolkit side?
Code:
Thank you for your workaround suggestion.
It seems like overriding entire method in AJAX Toolkit.
I'd like to wait some official update to be supplied from salesforce.
Shinichi.
of any other workaround, sorry.
I have made this change to the next version of the toolkit (9.0).
But it will be a while (2 or 3 months) for this to be released.
Creating workarounds for various browser differences is one thing, workarounds to support frameworks that change the behavior of javascript as a language is another. I'm glad to see that it's a minor change to the invoke call, but beware, as extensions and bolt-ons for the Apex AJAX toolkit emerge, you could end up with similar problems.
It's too bad too because prototype is a fair-dinkum library from the functional aspect, it's just the implementation that I take issue with.
FWIW :smileywink:
Guys ,Do you see that:
Just change the version to higher,i.e. 20.0 or higher.