Using document.location

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • itmanager8815
    New Member
    • Oct 2006
    • 1

    Using document.location

    I had a question regarding the use of document.locati on. I have the following script:

    <HTML>
    <BODY>

    <SCRIPT LANGUAGE=JAVASC RIPT>

    window.status=' ';

    document.locati on='file://c:/myfolder/myfile';

    </SCRIPT>

    </BODY>
    </HTML>

    This does not work when I browse to the page in Firefox but does in IE. If I enter the path in the Firefox address bar, it works; ie:

    file://c:/myfolder/myfile

    What am I doing wrong here?

    Also will this work if I browse to the page from another client? That is, will the web server redirect the client to the file located on the server's c: drive rather than the local client?

    I tried it from another machine and it did not seem to work.
  • Samus
    New Member
    • Oct 2006
    • 4

    #2
    just an opinion, you shouldn't use absolute paths because they stuck you in a fixed point of the directory hierarchy. Even worse if you add the "C:" because it (also) makes your script OS-dependant.

    Comment

    • steven
      New Member
      • Sep 2006
      • 143

      #3
      The path you're specifying will redirect people to a location on their own HD.

      Comment

      Working...