Fix the path to javascript if a parent folder is not root