I have created an HTML snippet which references a js file stored in site assets folder.
The path to this file in my snippet is as
../SiteAssets/MyJsFile.js
In SharePoint, welcome page is set to [siteURL]/pages/home.aspx
Now In home.aspx
, I have added a content editor web part having reference to above HTML snippet.
If I open home page using [siteURL]/pages/home.aspx
everything works perfectly, but if I open site using [siteUrl]
in the browser then it starts giving 404 error
for my js file.
How can I resolve this issue, does it mean in SP we can not give a relative path for the home page?