logo

New Response

« Return to the main article

You are replying to:

  1. Here's a handy function I use a lot to get the path of the current database in JavaScript. I find it useful to redirect the browser based on some UI changes, ie:

    location.href = getDBPath() + '/MyAgent?OpenAgent&Name=' + szName;

    Brendon Upson webWise Network Consultants http://www.wnc.net.au

    ------- code -------

    function getDBPath() { var pathname = window.location.pathname; var iPos = window.location.pathname.toString().toLowerCase().lastIndexOf('.nsf'); if(iPos>0) return pathname.substring(0, iPos+4);

    return pathname; }

Your Comments

Name:
E-mail:
(optional)
Website:
(optional)
Comment: