#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Location
    Frankfurt
    Posts
    6
    Rep Power
    0

    Question Opening an alternate url if open fails


    Hi,

    I need a link to a logfile which may be in one of two places (active or archive). I envisage using

    HREF='javascriptpenLog("logname")'

    which should open archive/logname if it exists otherwise active/logname.

    However, I can see no way of detecting whether or not archive/logname exists or whether the open was unsuccessful from within the javascript function.

    Any ideas?

    r0c0c0
  2. #2
  3. a rootin', tootin', shootin'
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Feb 2004
    Location
    location.href="hame"
    Posts
    3,464
    Rep Power
    103
    unless the file is on the local filesystem, there's nothing you can do.
  4. #3
  5. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Location
    Frankfurt
    Posts
    6
    Rep Power
    0
    Originally Posted by jbot
    unless the file is on the local filesystem, there's nothing you can do.
    It's on the local system so what can I do?
  6. #4
  7. a rootin', tootin', shootin'
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Feb 2004
    Location
    location.href="hame"
    Posts
    3,464
    Rep Power
    103
    checkout JScript/ActiveX and the FileSystem object at MSDN. (note: it's only Win-IE.)
  8. #5
  9. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Aug 2004
    Location
    Frankfurt
    Posts
    6
    Rep Power
    0
    Thanks - but that looks like some real programming is necessary

    There must be a simpler way to check whether a file (or more generally url) exists before opening it or of catching the open-failure. Or am I missing something??

    Any comments gratefully received ...
  10. #6
  11. a rootin', tootin', shootin'
    Devshed Loyal (3000 - 3499 posts)

    Join Date
    Feb 2004
    Location
    location.href="hame"
    Posts
    3,464
    Rep Power
    103
    nope, there isn't. browser's are generally blind (for want of a better expression) to what exists outside of their immediate experience. there's no way to tell if a file exists save thru coding: the browser just doesn't know anything on its own.

IMN logo majestic logo threadwatch logo seochat tools logo