문제

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.

도움이 되었습니까?

해결책

Try this

<script src="../../jslib/jquery351/jquery351.min.js"></script>
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 sharepoint.stackexchange
scroll top