Question

For some reason, relative URLs are not working OR I am using the wrong syntax. I have tried the following with no luck on my CEWP HTML page.

<script src="/jslib/jquery351/jquery351.min.js"></script>
<script src="../jslib/jquery351/jquery351.min.js"></script>
<script src="/../jslib/jquery351/jquery351.min.js"></script>
<script src="/.../jslib/jquery351/jquery351.min.js"></script>
<script src=".../jslib/jquery351/jquery351.min.js"></script>
<script src="~jslib/jquery351/jquery351.min.js"></script>

I was thinking of using the _spPageContextInfo.siteAbsoluteUrl function but I'm having issues implementing it into the HTML page to dynamically create the src string dynamically and having absolute URLs for test and production is getting old.

In a previous job, these worked so I'm wondering if this is a server setting out of curiosity.

Thanks.

Was it helpful?

Solution

Try this

<script src="../../jslib/jquery351/jquery351.min.js"></script>
Licensed under: CC-BY-SA with attribution
Not affiliated with sharepoint.stackexchange
scroll top