Sometimes you want to password protect a category or certain categories in your WordPress website. Or wish only logged-in users with appropriate roles to access protected categories or custom post types category (taxonomy) within a public blog.
Tag » Events
Event binding on dynamically created elements
Sometimes we load most of the page content using ajax dynamically. But this rendered html content generally does not bind with already defined events. But for making those events working, we need to rebind those events.
Prevent binding of events multiple times in jQuery
Either newbie or experienced developer, everyone occasionally stuck with a situation that it’s event binding runs in a loop or multiple times and it runs unexpected and we are unable to find the bug because we bind the event only one time but in practical it binds so multiple times.
event.preventDefault() vs. return false
event.preventDefault() vs. return false is a very important but confusing topic that which one should be used and for what. When we want to prevent other event handlers from executing after a certain event is fired, we can use one of these two techniques