#Quick help
25 messages · Page 1 of 1 (latest)
$(document).keypress(function() {
if (!started) {
$("#level-title").text("Level " + level);
nextSequence();
started = true;
}
});
can somebody spot the difference between the two besides the indent?
the first code doesn't work but the second does
does the indentation in the first code cause it to not fun properly?
Exact same code, also why jQuery
right? I thought so too but the first one doesn't run for some reason
I'm just learning it. Is it not useful?
It was popular, now it's not.
so the first code, I typed out myself. but the second code is a copy paste from the solution. i have no idea why the one i typed out doesnt work
I would recommend just doing normal js dom stuff instead of jquery
yh idk either, searching for the code on discord shows both posts and theres no difference other than spaces
theres no difference in my vs code either just the spacing this is so frustrating idk what im doing wrong
what if you take the not working one and remove spacing to be the same lol
but like, indentation doesn't matter in js so idk why it wouldn't work
how can i make the indent shorter?
Oh I see why 🤦♂️
You're missing a closing ) in the $ function
Discord ignored the difference... fuzzy search sometimes
ok now it works 🤣
thanks so much man i was losing my mind over this
about jquery. it is not used at all anymore? Im trying to get a job as a web dev
👍 , would just leave jQuery alone for your next project
And no it's not that used anymore, maybe a small company might still be using it but like... yeah not a lot of companies use vanilla js for their projects let alone jQuery, most use frameworks.
It was big because of javascript not being very good / easy to use to access the dom back in the days
But js has improved beyond jQuery and it's not very useful anymore
ah i see i will keep that in mind thanks so much