#Quick help

25 messages · Page 1 of 1 (latest)

vast lark
#
$(document).keypress(function() {
    if (!started) {
        $("#level-title".text("Level " + level));
        nextSequence();
        started = true;
    }
});
kindred jungleBOT
#
You can format your code using codeblocks! Discord supports syntax highlighting for most languages:
💠💠💠

```js
console.log("hello world")
```

This will produce

console.log("hello world")
```Replace 'js' with the language you're using (e.g. 'cpp' for C++;  'py' for Python)
vast lark
#
$(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?

frozen willow
#

Exact same code, also why jQuery

vast lark
#

right? I thought so too but the first one doesn't run for some reason

vast lark
frozen willow
vast lark
frozen willow
#

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

vast lark
frozen willow
#

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

vast lark
#

how can i make the indent shorter?

frozen willow
vast lark
#

why

#

ohhhhhhhhhhhh

frozen willow
#

Discord ignored the difference... fuzzy search sometimes

vast lark
#

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

frozen willow
#

👍 , 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

vast lark
#

ah i see i will keep that in mind thanks so much