I added a custom script to my "Style Library" folder under a site collection , the site collection url is as follow `http://servername/HR`. so to reference the script inside my master page i wrote the following :-

    <script  type="text/javascript" src="/hr/Style%20Library/Custom JS/HideTreeViewFolder.js" ></script>

where i am manually referencing the `/hr/`  in side the `src`, so can i make this more dynamic and get the site collection url dynamically, so if i move the site collection to another URL the script will still get referenced   ?

now i tried adding "`..`" sand seems it will correctly reference the folder inside the site collection,, but not sure if this is valid ?
   

      <script  type="text/javascript" src="../Style%20Library/Custom JS/HideTreeViewFolder.js" ></script>