Relate scripts and style tags with js

1

Ihavethesescriptstagsthatareusedtoadjustandgivefunctionstoacarousel.ButIamaddingthecarouselassoonasIclickonabutton,butasthepagehasalreadybeenrenderedthesescriptsenduphavingnoeffectonthecarouselthatwasadded.HowcanIgetthesescripttagstobe"reread" as soon as I click on the button? I believe if they are read by the browser after I have added the carousel, the scripts have effect.

    
asked by anonymous 02.11.2018 / 02:06

1 answer

0

Reloading the scripts will not help.

Depending on your framework, it may try to start some plugins automatically when the window loads, even if you remove and insert the scripts again, window.onload events will not be invoked again.

In this case if you decide to add another carousel after the page is already loaded, you have to start these plugins manually. How to do this? I can not answer you, it will vary from the API of your framework. Probably something like $('#meu_carrossel').carrossel() , try checking the documentation.

    
02.11.2018 / 02:33