Html template Soft Rejected for 2nd time for the reason PROPER EVENT BINDING

Hi guys,

My html template was first soft rejected for only one reason and the reviewer gave the following comment:

“PROPER EVENT BINDING: Consider using the preferred .on() method rather than .click(), .bind(), .hover(), etc. For best performance and concise code use event delegation whenever possible”

Unfortunately the link that he gave me of an example article was broken but lately i found that article on one of the threads in Themeforest forum. But i tried to find out related topics on google as well as on themeforest forum, but i couldn’t find a proper solution for it. Whatever i understood from the articles, i tried to implement it on my main scripts. So For example,
According to the comment:

“Consider using the preferred .on() method rather than .click()”

So what i did is that i removed .click() and changed it to .on() method and since i am not using bind(), .hover() so i thought that now it will get accepted this time. But unfortunately it got rejected again and this time the reviewer gave almost same comment but he mentioned .load(), .ready() like you can see below is the new comment from the reviewer.

“PROPER EVENT BINDING: Consider using the preferred .on() method rather than .click(), .bind(), .hover(), .load(), .ready(), etc. For best performance and concise code use event delegation whenever possible”

I don’t know what to do now because i don’t want my item to get hard rejected lol so i need your help guys :slight_smile: .

Event binding is an alternate better way of using $(’.stuff’).click(function(){}. It becomes $(’.stuff’).bind(‘click’,function(){} and this is the newest jquery technique applied to events. In some cases this is not a good idea but generally this is best practice. Just updated your custom code where you have click events to this method and be sure to read more about jQuery .bind(). Cheers! :slight_smile:

Hey,

Thank you so much!. You explained way better and in simple way than the articles out there lol. Great one!

1 Like

I hope this time my template gets accepted :slight_smile:

Haha! Glad to have helped out! Good luck with your item review process! Cheers! :slight_smile: