window.location= 'file:\\\c:\sharefolder'; is not working

Discussion in 'JavaScript' started by james1986, Feb 1, 2009.

  1. #1
    Hi Guys,

    i try to open my local system share folder in browser using command
    window.location= 'file:\\\c:\sharefolder';
    where the folder sharefoler is in c;\ and it is shared

    it is not opening in firefox and Google Chrome
    :) can you help me pls :)
     
    james1986, Feb 1, 2009 IP
  2. Bagi Zoltán

    Bagi Zoltán Well-Known Member

    Messages:
    364
    Likes Received:
    23
    Best Answers:
    0
    Trophy Points:
    110
    #2
    I suppose it happens because the window.location should be URL related string. More details can be found here.
     
    Bagi Zoltán, Feb 1, 2009 IP
  3. javaongsan

    javaongsan Well-Known Member

    Messages:
    1,054
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    128
    #3
    use forward slash
    window.location = "file:///C:/sharefolder"
     
    javaongsan, Feb 2, 2009 IP
  4. sohamj

    sohamj Member

    Messages:
    47
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    41
    #4
    try
    window.location = "file:///C://sharefolder"

    should be ok
     
    sohamj, Feb 3, 2009 IP