orcid-js icon indicating copy to clipboard operation
orcid-js copied to clipboard

Uncaught TypeError: $.when.all is not a function

Open seyfcom opened this issue 7 years ago • 3 comments

Hi I got this error when I try to use your script into a CMS modx for a client. There is already an old jquery version, I used the $.noConflict() function but I keep having the same error.

It finds the nunmbers of work for a person with the ORCID but then fails at

`orcid.js:155

Uncaught TypeError: $.when.all is not a function at orcid.js:155 at Array.forEach () at Object.fetchCiteprocJSONForSimpleWorksOneByOne (orcid.js:151) at orcid.js:312 at response (operation.js:706) at responseInterceptor (http.js:53) at obj.on.response (http.js:57) at resolver.js:1 at Request.callback (client.js:844) at Request. (client.js:488)`

Do you have any idea how to get through? For some reason it doesnt see the part: if (jQuery.when.all===undefined) {...

seyfcom avatar Oct 31 '17 14:10 seyfcom

Hi,

I had a similar problem a while ago. If I remember correctly it has to do with the jquery: there is a minimum version of jquery.min.js ( 2.1.3), below which orcid.js seems to generate this error.

Check whether the correct version of jquery is loaded when calling orcid.js.

Ulli

On 31 Oct 2017, at 15:24, seyfcom [email protected] wrote:

Hi I got this error when I try to use your script into a CMS modx for a client. There is already an old jquery version, I used the $.noConflict() function but I keep having the same error.

It finds the nunmbers of work for a person with the ORCID but then fails at

`orcid.js:155

Uncaught TypeError: $.when.all is not a function at orcid.js:155 at Array.forEach () at Object.fetchCiteprocJSONForSimpleWorksOneByOne (orcid.js:151) at orcid.js:312 at response (operation.js:706) at responseInterceptor (http.js:53) at obj.on.response (http.js:57) at resolver.js:1 at Request.callback (client.js:844) at Request. (client.js:488)`

Do you have any idea how to get through? For some reason it doesnt see the part: if (jQuery.when.all===undefined) {...

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/ORCID/orcid-js/issues/8, or mute the thread https://github.com/notifications/unsubscribe-auth/AGMukl9j-0s6XLDqumrwYTEb3MMuxcnBks5sxy2dgaJpZM4QM0t2.

ulli-steiner avatar Oct 31 '17 14:10 ulli-steiner

Hi, Yes I tried from jquery 2.2.x to 3.x and had the same error. I just can't understand what's going on here

seyfcom avatar Nov 01 '17 08:11 seyfcom

The problem for me was (using ModX Evolution) is that other javascripts were loading depreciated version of jquery, effectively overwriting the jquery loaded in the header chunks of my own script.

Ulli

On 1 Nov 2017, at 09:09, seyfcom [email protected] wrote:

Hi, Yes I tried from jquery 2.2.x to 3.x and had the same error. I just can't understand what's going on here

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/ORCID/orcid-js/issues/8#issuecomment-341029109, or mute the thread https://github.com/notifications/unsubscribe-auth/AGMukvK8SUKfXmjHXPMapNAcSXEami6Mks5syCcdgaJpZM4QM0t2.

ulli-steiner avatar Nov 01 '17 08:11 ulli-steiner