Which of the following statements about HubL and JavaScript is TRUE?
Choose an answer
Tap an option to check your answer.
Correct answer: JS written in the HTML + HubL section of the module editor will be repeated on a page for every instance of a module unless it is wrapped in a require_js statement..
Why this is the answer
The correct answer states that JavaScript in the HTML + HubL section of a module will repeat for every module instance unless wrapped in requirejs. This is true because the HTML + HubL section is rendered once per module instance. Without requirejs, which ensures a script is loaded only once per page, the same JavaScript code would be injected multiple times, leading to potential conflicts or unnecessary resource loading. HubL cannot be used in the JS sections of the module editor; those sections are strictly for JavaScript. HubL tags do not have a postjsrendering attribute for passing JS data back to HubL; HubL is processed server-side before JavaScript executes client-side. Module builders use HubL to add module fields to their markup, not JavaScript.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed