WHY CAN'T I GET JQUERY! | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

WHY CAN'T I GET JQUERY!

What ever I do I cannot get JQUERY on sololearn please help I have so many great ideas that I know how to do but can't because I can't get JQUERY to work and I would learn the original JavaScript but it's hard to find anyone who will teach me when most online classes just use JQUERY can some one please help me

16th Nov 2019, 6:51 AM
Ben Carvalho
Ben Carvalho - avatar
14 Answers
+ 10
SoloLearn compiles web codes by putting scripts in JS tab in <head>, so your $("button") is returning null because the button is not rendered yet. Solution is to wrap your scripts in callback of window.onload https://code.sololearn.com/W5AvK6tMvZn9/?ref=app
16th Nov 2019, 8:06 AM
Gordon
Gordon - avatar
+ 8
https://www.sololearn.com/learn/jQuery/2785/
16th Nov 2019, 7:37 AM
Gordon
Gordon - avatar
+ 8
please don't aim for badge, you cannot take virtual achievements out of this platform. I just downvoted your question with the goodwill to discourage you from falling into psychological traps of evil tech app. for the position of script, let me explain a more fundamental concept : there are different places to put JavaScript tags <script> in a <html> for <script> in <head>, it will run before <body> because <body> is not processed at that moment, so there is no elements such as <button> yet, so your get element methods will fail even for plain JavaScript.
16th Nov 2019, 8:37 AM
Gordon
Gordon - avatar
+ 4
find a Try It Yourself and click it. See the <script> in head?
16th Nov 2019, 7:43 AM
Gordon
Gordon - avatar
+ 4
Show your code here
16th Nov 2019, 7:49 AM
Gordon
Gordon - avatar
+ 3
Look at examples in the jquery tutorial.
16th Nov 2019, 9:34 PM
Sonic
Sonic - avatar
+ 3
Learn before asking all these questions https://www.sololearn.com/Course/jQuery/?ref=app
17th Nov 2019, 10:44 AM
Isaac Duah [Active!]
Isaac Duah [Active!] - avatar
+ 2
https://www.sololearn.com/learn/jQuery/2785/?ref=app You can learn from sololearn
17th Nov 2019, 1:17 AM
Master Genius [ INACTIVE ]
Master Genius [ INACTIVE ] - avatar
+ 2
Or see my jQuery code which use much jQuery https://code.sololearn.com/WPuy7TqQ8x66/?ref=app
17th Nov 2019, 1:18 AM
Master Genius [ INACTIVE ]
Master Genius [ INACTIVE ] - avatar
+ 1
Gordon that doesn't help I've tried going to the JQUERY lesson and what it told me to do didn't work
16th Nov 2019, 7:39 AM
Ben Carvalho
Ben Carvalho - avatar
+ 1
Gordon iv used JQUERY before and know how it works and how you have to put a script in the head with the src and the link and every thing and iv done it before but it's not working properly in sololearn
16th Nov 2019, 7:46 AM
Ben Carvalho
Ben Carvalho - avatar
16th Nov 2019, 7:54 AM
Ben Carvalho
Ben Carvalho - avatar
+ 1
Gordon got none of that but thanks for the help I'm done coding for the night because I don't know what time it is for you but it's 3am where I am I think what you said will make more sense to me in the morning... Or afternoon depends on how long I sleep p.s. would you mind giving my question a like I'm trying to get the bage
16th Nov 2019, 8:12 AM
Ben Carvalho
Ben Carvalho - avatar
+ 1
Sorry about the bage thing thanks for the help again but I'm going to bed now I think I get what you mean and will take it into account while coding in the future p.s. I don't make online awards like that control my life I just think there fun
16th Nov 2019, 8:42 AM
Ben Carvalho
Ben Carvalho - avatar