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?
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?
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...
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...
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
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
scripandscript#idto theselectorssection 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?I have same problem
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...