Adobe RoboHelp: Get Relative Link to Project Root
The following function returns the relative path to the project start page. Usefull if you want to create dynamic links.
This script works with WebHelp and CHM.
function RootPath() { try{ var path = _getRelativePath(document.location.toString(), gsStartPage); } catch(e) {//Normally this happens because we're in a CHM var CHM = function () { var location = document.location.toString(); var gsStartPage = location.split(/::\//g); var relpath = gsStartPage[1].split(/\//g); var path = ''; for(var i=0;i