Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
I'm happy that I don't need to deal with this kind of bullshit using a compiled language.
-
LuxARTS16136yUsing inline events on HTML is not a good practice. You should add:
DOM.addEventListener("click", function(){
//whatever
}); -
@LuxARTS I know about this but I never understood why. If I ever look back at the code and use inline event trigger I get a report for a broken feature, see exactly when what triggers why and have a much easier time debugging than looking through the computed listeners. The only sensible argument I come to is that they hide the internal workings but I never understood why someone would want that.
-
LuxARTS16136yBecause the "code" is not the HTML file, is the JavaScript file. If you want to get info about the event simply set a variable to send to the trigger function and read it.
DOM.addEventListener("click", function(event){
console.log(event);
});
Wondering why that link doesn't work.
My junior developer uses onlick instead of onclick.
joke/meme