I have a mean-stack site.
Usually all my external links are listed in index.html
I understand that one external JS library (e.g. https://cdnjs.cloudflare.com/troublelibrary.js ) I have some conflict with part of my website. So the workaround I'm looking for is NOT to download it for a specific path https://www.myexample.com/specific .
Does anyone know how to achieve this in routing?
Edit 1: (see full question here )
In fact, a library that has conflit has a value of history.js . My original code, which loads it all the time, is as follows. As a result, https://localhost:3000/home in the browser is always https://localhost:3000/home (i.e. it wonβt add # because of history.js )
<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script> <script src="https://cdn.rawgit.com/devote/HTML5-History-API/master/history.js"></script>
Then, if I try the following code, as Ben says:
<script src="https://appsforoffice.microsoft.com/lib/1/hosted/office.js"></script> <script> var newScript = document.createElement('script'); newScript.src = 'https://cdn.rawgit.com/devote/HTML5-History-API/master/history.js'; document.head.appendChild(newScript); console.log(window.location.href) </script>
I understand that the first time you download https://localhost:3000/home will not change. But, if I update the browser, it may change to https://localhost:3000/#/home .
So adding a script is not exactly the same as a direct link, does anyone know why?