Unobtrusive events with jQuery
In the last few years, it has been a good practice to remove all JavaScript from HTML templates. If we remove all JavaScript code from HTML templates and encapsulate it in JavaScript files, we are doing imperative programming. On the other hand, if we write JavaScript code or use components and bindings in HTML files, we are using declarative programming. Many programmers don't like to use declarative programming. They think this makes it more difficult for designers to work with templates. We should note that designers are not programmers and they may not understand JavaScript syntax. Besides, declarative programming splits related code into different files and may make it difficult to understand how the entire ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access