+ 2

Include jQuery in Sololearn Code?

Can we include jQuery in Sololearn Code?

26th Oct 2019, 9:40 AM
Muhammad Zaini
Muhammad Zaini - avatar
7 Réponses
+ 3
Hey Zen! The reason you are getting the error is because jQuery hasn't loaded fully yet. Surround your JavaScript code with: window.onload = function () { // Your code }; That will allow jQuery to load before executing your code. Hope it helps :)
26th Oct 2019, 12:52 PM
Edwin Pratt
Edwin Pratt - avatar
+ 9
Zen I am not a JQuery user, so we will wait for a JQuery user to answer you.
26th Oct 2019, 10:38 AM
Sonic
Sonic - avatar
+ 6
Yes it is possible. Look at the JQuery tutorial.
26th Oct 2019, 10:11 AM
Sonic
Sonic - avatar
+ 2
Sonic I have placed script:src jQuery in body tag. Then, I type $('.result').html('test') in JS section. Error: $ is not defined. Must I place jQuery script:src in head tag?
26th Oct 2019, 10:32 AM
Muhammad Zaini
Muhammad Zaini - avatar
+ 1
Thanks Edwin Pratt [Less Active; Family] . I think that will worked.
26th Oct 2019, 12:58 PM
Muhammad Zaini
Muhammad Zaini - avatar
27th Oct 2019, 10:05 AM
Muhammad Zaini
Muhammad Zaini - avatar