Message from JavaScript discussions

November 2020

— If( === 'yourAction') do what you have to do (?)


Cause I know how to do this but I think when I put this code in a function and call it like this <script src="main.js">loginSubmit();</script> i think its bad practice right?

— No this is not what I mean

— I have this script in 1 js file and the js file is called in the register page and the login page but it can't find the form on the registerpage

Message permanent page

— So I get an error

— Bad practice is, for example when you use jquery (old approach instead of new), in your case seems everything is screwed🤤

Message permanent page

— I i'm forced to use jquery at work xD

— Bad practice man!

— Because everyone else use jquery and they must be sure that when they open one of my projects they can edit it easely

Message permanent page

— determin1st good help

— How do I put 2 of those functions in 1 file

— And only call the right one in each page