You are not logged in. Your edit will be placed in a queue until it is peer reviewed.
We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.
Required fields*
-
thanks but I don't see how the 3rd option differs from what you point out is bad practice, it is inline JavaScript.Holly– Holly2017年12月04日 23:27:33 +00:00Commented Dec 4, 2017 at 23:27
-
@Holly: In short, bad practices is you leave your business logic code in the template file. The business logic code must be put inside JS components, like what Magento 2 do (UI widget), then from the template file what you did is just initialise it not using it for any specified task in the template.Toan Nguyen– Toan Nguyen2017年12月04日 23:36:59 +00:00Commented Dec 4, 2017 at 23:36
-
I see, by the way is ‘domReady!’ just likes jQuery’s document.ready functionHolly– Holly2017年12月08日 06:48:39 +00:00Commented Dec 8, 2017 at 6:48
default