You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi.
I wan to have different <script src> tags in different pages.
All of my pages have same DOM (except script tags) and my new HTML content is replaced successfully inside of specified div.
But I don't know why these <script> tags are not loaded in new pages.
Therefore I added scrip and script#id to the selectors section to load new script tags, but it results in full page loading.
I know this approach is not correct.
So, How can I have different <script> sections for different pages?
The text was updated successfully, but these errors were encountered:
BigGitWorld
changed the title
different script for different pages?
different script for different pages? (it seems the lib does not work anymore)
Nov 18, 2020
BigGitWorld
changed the title
different script for different pages? (it seems the lib does not work anymore)
different script for different pages?
Nov 18, 2020
I solved this in the past by comparing the fetched DOM scripts to the current ones, then loading the new ones (the ones not present in the current page) dynamically (either with native import or with a third-party library such as systemjs or requirejs...).
While this worked very well for script files, I couldn't find an equally clean solution for inline scripts, for which I ended up using eval...
Hi.
I wan to have different
<script src>
tags in different pages.All of my pages have same DOM (except script tags) and my new HTML content is replaced successfully inside of specified div.
But I don't know why these <script> tags are not loaded in new pages.
Therefore I added
scrip
andscript#id
to theselectors
section to load new script tags, but it results in full page loading.I know this approach is not correct.
So, How can I have different
<script>
sections for different pages?The text was updated successfully, but these errors were encountered: