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 ...

Get KnockoutJS Essentials now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.