Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 7 of 7
  1. #1
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

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

    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

  • #2
    Senior Coder
    Join Date
    Oct 2008
    Location
    Long Beach
    Posts
    1,196
    Thanks
    36
    Thanked 164 Times in 164 Posts
    Use forward slashes, browsers read virtual addresses.

    window.location= "file:///c:/sharefolder";
    Feel free to e-mail me if I forget to respond ;)
    ohsosexybrit@gmail.com

  • #3
    Regular Coder
    Join Date
    Nov 2007
    Location
    Leeds, UK
    Posts
    514
    Thanks
    24
    Thanked 19 Times in 19 Posts
    Can i ask why do you want to point some one to a local directory
    Working towards a Internet where we don't have website just browser applications Kill the Hyper-link and say hello to 3D Games in the browser :)

  • #4
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer

    hi,
    i can't user forward slashes. since ,the local folder can represent by using backslash.

    and the main thing is

    WHILE I PLACE THE URL file:\\\c:\sharefolder

    direct in the address bar it is opening a local folder.
    but
    while i try this by using javascript it is not opening. so only i need to know
    why it is not opening by using javascript?

  • #5
    Regular Coder
    Join Date
    Dec 2008
    Location
    Tannhäuser Gate
    Posts
    286
    Thanks
    7
    Thanked 58 Times in 57 Posts
    It is not opening using Javascript because you are not following the advice you were given after asking your question.

    Use forward slashes.

  • #6
    New to the CF scene
    Join Date
    Jan 2009
    Posts
    3
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Internet Explorer

    hi,
    i tryed both but it is not opening. here is my code.


    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
    <title>Untitled Document</title>
    <script language="JavaScript">
    function whatFile() {
    window.location= 'file:///c:/sharefolder' ;
    }
    </script>
    </head>

    <body>
    <input type="button" name="but" value="button" style="top:200px; left:200px;" onClick="javascript:whatFile()"/>
    </body>
    </html>



    In this i tried both slashes forward and back slash. it is not opening

  • #7
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    18,300
    Thanks
    203
    Thanked 2,561 Times in 2,539 Posts
    It works for me, so the trouble must be an incorrect path to the file.

    <script language="JavaScript"> is deprecated. Use <script type = "text/javascript"> instead.

    Remove the red:- onClick="javascript:whatFile()"/>


    It is your responsibility to die() if necessary… - PHP Manual


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •