Quantcast
Channel: SharePoint 2013 - Development and Programming forum
Viewing all articles
Browse latest Browse all 7589

Relative JS file reference from a custom page

$
0
0

I have HTML page inside a folder in style library called: Employee.html, so the link is: /style library/MyProject/Employee.html, I have also JS file inside the same folder called Employee.JS, I added a content editor web part to the page and referenced this HTML page. I am referencing the JavaScript file from the Employee.html like this: 

<script type="text/javascript" language="javascript" src="Employee.js"></script>

As they exist in the same folder. But when rendered in content editor web part, it's referenced based on the page inside the site pages library. So it's expecting the file to be in: sitepages/Employee.js. 

What's the best practice to reference files in a relative way between custom html page and js files? 


Viewing all articles
Browse latest Browse all 7589

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>