Shopify checkout liquid 模板 page:load 事件和 DOMContentLoaded 有什么区别?
What is the difference between Shopify checkout liquid template page:load event and DOMContentLoaded?
Shopify checkout liquid 提供了一个名为的事件:
page:load
不幸的是,文档很少。
page:load 和常规 JavaScript DOMContentLoaded 事件有什么区别?
The DOMContentLoaded event fires when the initial HTML document has
been completely loaded and parsed, without waiting for stylesheets,
images, and subframes to finish loading.
All of the checkout steps are hosted at a single URL path, where the
content is loaded dynamically depending on the current step.
Shopify 很可能在 DOMContentLoaded 上加载了一些内容,并在所有内容都触发了 page:load 事件已准备就绪,您可以进行 DOM 自定义。此外,DOMContentLoaded 只会在整个结帐过程中触发一次,而 page:load 会在每个结帐步骤中触发一次。
page:load 的文档中描述了同样的事情。
The page:load event is triggered when the content of each step is
loaded. This is the default event that you should use when adding
content into the page on load.
Shopify checkout liquid 提供了一个名为的事件:
page:load
不幸的是,文档很少。 page:load 和常规 JavaScript DOMContentLoaded 事件有什么区别?
The DOMContentLoaded event fires when the initial HTML document has been completely loaded and parsed, without waiting for stylesheets, images, and subframes to finish loading.
All of the checkout steps are hosted at a single URL path, where the content is loaded dynamically depending on the current step.
Shopify 很可能在 DOMContentLoaded 上加载了一些内容,并在所有内容都触发了 page:load 事件已准备就绪,您可以进行 DOM 自定义。此外,DOMContentLoaded 只会在整个结帐过程中触发一次,而 page:load 会在每个结帐步骤中触发一次。
page:load 的文档中描述了同样的事情。
The page:load event is triggered when the content of each step is loaded. This is the default event that you should use when adding content into the page on load.