Magento 2 Init script after page loadIn Magento2 what is <script type=“text/x-magento-init”>?Magento2 <script type=“text/x-magento-init”> after ajaxMagento 2 - load cms pageCheckout loader overlay not disappearing after page load completionSome java script failed to loadLoad CMS Block or PHTML file after page loaddata-mage-init not working on CMS pageMagento 1.9 - Load external script async the right wayRun JavaScript after data-mage-init / mage.apply() has finished loadingLoad a jQuery script after fully loading the page

Elements other than carbon that can form many different compounds by bonding to themselves?

Can SQL Server create collisions in system generated constraint names?

a sore throat vs a strep throat vs strep throat

Can someone publish a story that happened to you?

Does tea made with boiling water cool faster than tea made with boiled (but still hot) water?

How does Captain America channel this power?

Map of water taps to fill bottles

If a planet has 3 moons, is it possible to have triple Full/New Moons at once?

Pre-plastic human skin alternative

How can I practically buy stocks?

How can Republicans who favour free markets, consistently express anger when they don't like the outcome of that choice?

How do I reattach a shelf to the wall when it ripped out of the wall?

Rivers without rain

"The cow" OR "a cow" OR "cows" in this context

Which big number is bigger?

Was there a Viking Exchange as well as a Columbian one?

Re-entry to Germany after vacation using blue card

What makes accurate emulation of old systems a difficult task?

Providing evidence of Consent of Parents for Marriage by minor in England in early 1800s?

Contradiction proof for inequality of P and NP?

Why did C use the -> operator instead of reusing the . operator?

How to have a sharp product image?

What happens to Mjolnir (Thor's hammer) at the end of Endgame?

Does a large simulator bay have standard public address announcements?



Magento 2 Init script after page load


In Magento2 what is <script type=“text/x-magento-init”>?Magento2 <script type=“text/x-magento-init”> after ajaxMagento 2 - load cms pageCheckout loader overlay not disappearing after page load completionSome java script failed to loadLoad CMS Block or PHTML file after page loaddata-mage-init not working on CMS pageMagento 1.9 - Load external script async the right wayRun JavaScript after data-mage-init / mage.apply() has finished loadingLoad a jQuery script after fully loading the page






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








2















Is there any option to init (text/x-magento-init) script after page load? Example, I am working on a simple quickview feature and my controller returns my a layout - phtml file - with rendered html and script with config like this below:



<script type="text/x-magento-init">

"[data-role=swatch-options]":
"Magento_Swatches/js/swatch-renderer":
"jsonConfig": ...







New content is appended to modal wrapper and new popup is initialized. Is there any option to fire (maybe some kind of event od body/document) which triggers again init process for Magento_Swatches/js/swatch-renderer script?










share|improve this question






















  • Did you get to the bottom of how to do this. I need to initialise swatches on ajax loaded product list as not working with infinite scrolls so may be similar?

    – harri
    Sep 19 '18 at 10:09

















2















Is there any option to init (text/x-magento-init) script after page load? Example, I am working on a simple quickview feature and my controller returns my a layout - phtml file - with rendered html and script with config like this below:



<script type="text/x-magento-init">

"[data-role=swatch-options]":
"Magento_Swatches/js/swatch-renderer":
"jsonConfig": ...







New content is appended to modal wrapper and new popup is initialized. Is there any option to fire (maybe some kind of event od body/document) which triggers again init process for Magento_Swatches/js/swatch-renderer script?










share|improve this question






















  • Did you get to the bottom of how to do this. I need to initialise swatches on ajax loaded product list as not working with infinite scrolls so may be similar?

    – harri
    Sep 19 '18 at 10:09













2












2








2


2






Is there any option to init (text/x-magento-init) script after page load? Example, I am working on a simple quickview feature and my controller returns my a layout - phtml file - with rendered html and script with config like this below:



<script type="text/x-magento-init">

"[data-role=swatch-options]":
"Magento_Swatches/js/swatch-renderer":
"jsonConfig": ...







New content is appended to modal wrapper and new popup is initialized. Is there any option to fire (maybe some kind of event od body/document) which triggers again init process for Magento_Swatches/js/swatch-renderer script?










share|improve this question














Is there any option to init (text/x-magento-init) script after page load? Example, I am working on a simple quickview feature and my controller returns my a layout - phtml file - with rendered html and script with config like this below:



<script type="text/x-magento-init">

"[data-role=swatch-options]":
"Magento_Swatches/js/swatch-renderer":
"jsonConfig": ...







New content is appended to modal wrapper and new popup is initialized. Is there any option to fire (maybe some kind of event od body/document) which triggers again init process for Magento_Swatches/js/swatch-renderer script?







magento2 layout javascript controllers swatches






share|improve this question













share|improve this question











share|improve this question




share|improve this question










asked Jan 24 '18 at 11:27









RobRob

96112




96112












  • Did you get to the bottom of how to do this. I need to initialise swatches on ajax loaded product list as not working with infinite scrolls so may be similar?

    – harri
    Sep 19 '18 at 10:09

















  • Did you get to the bottom of how to do this. I need to initialise swatches on ajax loaded product list as not working with infinite scrolls so may be similar?

    – harri
    Sep 19 '18 at 10:09
















Did you get to the bottom of how to do this. I need to initialise swatches on ajax loaded product list as not working with infinite scrolls so may be similar?

– harri
Sep 19 '18 at 10:09





Did you get to the bottom of how to do this. I need to initialise swatches on ajax loaded product list as not working with infinite scrolls so may be similar?

– harri
Sep 19 '18 at 10:09










1 Answer
1






active

oldest

votes


















0














MAy be you try afterRender function to initialize function after load something you want, Take a look on following document :
Js Referrence






share|improve this answer


















  • 1





    thank for your reply! Nice try, but I am working with mixin which based on $.widget (mage.catalogAddToCart), so KO template functions are not visible there

    – Rob
    Jan 24 '18 at 12:06











Your Answer








StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "479"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













draft saved

draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f210809%2fmagento-2-init-script-after-page-load%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














MAy be you try afterRender function to initialize function after load something you want, Take a look on following document :
Js Referrence






share|improve this answer


















  • 1





    thank for your reply! Nice try, but I am working with mixin which based on $.widget (mage.catalogAddToCart), so KO template functions are not visible there

    – Rob
    Jan 24 '18 at 12:06















0














MAy be you try afterRender function to initialize function after load something you want, Take a look on following document :
Js Referrence






share|improve this answer


















  • 1





    thank for your reply! Nice try, but I am working with mixin which based on $.widget (mage.catalogAddToCart), so KO template functions are not visible there

    – Rob
    Jan 24 '18 at 12:06













0












0








0







MAy be you try afterRender function to initialize function after load something you want, Take a look on following document :
Js Referrence






share|improve this answer













MAy be you try afterRender function to initialize function after load something you want, Take a look on following document :
Js Referrence







share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 24 '18 at 11:54









Shashank GuptaShashank Gupta

536413




536413







  • 1





    thank for your reply! Nice try, but I am working with mixin which based on $.widget (mage.catalogAddToCart), so KO template functions are not visible there

    – Rob
    Jan 24 '18 at 12:06












  • 1





    thank for your reply! Nice try, but I am working with mixin which based on $.widget (mage.catalogAddToCart), so KO template functions are not visible there

    – Rob
    Jan 24 '18 at 12:06







1




1





thank for your reply! Nice try, but I am working with mixin which based on $.widget (mage.catalogAddToCart), so KO template functions are not visible there

– Rob
Jan 24 '18 at 12:06





thank for your reply! Nice try, but I am working with mixin which based on $.widget (mage.catalogAddToCart), so KO template functions are not visible there

– Rob
Jan 24 '18 at 12:06

















draft saved

draft discarded
















































Thanks for contributing an answer to Magento Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid


  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.

To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f210809%2fmagento-2-init-script-after-page-load%23new-answer', 'question_page');

);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Sum ergo cogito? 1 nng

三茅街道4182Guuntc Dn precexpngmageondP