From: Miguel <mi...@jm...> - 2005-09-28 14:22:54
|
Craig wrote: > Regarding the message header above, I have a project I'm working on > that needs to be run both locally and from the WEB. By running locally I assume that you mean using file:// > I'd like to > include the ability to load a remote structure, as you suggest, but > its peripheral to the project and I want my code to detect whether > the person can actually access his code (ie., they might be offline) > and omit the option in that case. You can detect whether or not someone is accessing the page directly on their local file system by looking at the variable document.location As in: <script> alert(=22This page is =22 + document.location=22); </script> Use string functions to see whether or not document.location starts with =22file://=22 > What is the easiest way for my code to detect whether or not his > remote JavaScript has run successfully? I don't know how to detect whether or not code has failed. Miguel |