Comrades, help, please. I am not familiar with JS and jQuery, but I already sat down with them. Unfortunately, they gave me only a week for the assignments - please help. Here are two tasks:
one). We write most client javascript using jQuery. In order to maximize this, we try to use the capabilities of the framework as little as possible, including little-known ones.
Task. You need to make a plugin that allows you to use, in the standard way for jQuery, the event “click with the left mouse button only”.
2). We pay great attention to the performance of our applications in general. It is not rare that a single function (for example, an event handler) runs long enough, but is called more often than it would be sufficient for the user qualities of the entire system.
The task is about one of the ways to fix the situation. You need to implement a common solution (using the decorator pattern), which allows you to call any function no more than N times per second, even if the call to this function occurs more often.
Thank.