logo

Response

« Return to the main article

You are viewing this page out of context. To see it in the context it is intended please click here.

About This Page

Reply posted by Jake Howlett on Thu 19 Apr 2001 in response to Opening database relative URLs in JavaScript

Re: A couple of "Gotchas"

Good points David. And to think I call myself a developer....


There is a lcase equivalent in JS. It would be:


path = location.pathname.toLowerCase().split('.nsf')[0] + '.nsf/';


This would present another gotcha however, in that, if the DB lives on a *nix
server then the file name is case-sensitive and this would lead to a 404 error.


There is also a problem in your workaround, where you look for the last "/". If
you are at the root level of a database. i.e the homepage and the location is
"/dir/db.nsf" the file name returned would be "/dir/". So what's the perfect
solution to this then I wonder? I think I'll stick to naming all my DBs in
lower case.


Thanks for the feedback.....


Jake
-CodeStore