james1986
01-26-2009, 07:49 AM
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 :)
itsallkizza
01-26-2009, 08:00 AM
Use forward slashes, browsers read virtual addresses.
window.location= "file:///c:/sharefolder";
barkermn01
01-26-2009, 09:04 AM
Can i ask why do you want to point some one to a local directory
james1986
01-27-2009, 06:27 AM
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?
freedom_razor
01-27-2009, 10:31 AM
It is not opening using Javascript because you are not following the advice you were given after asking your question.
Use forward slashes.
james1986
02-02-2009, 05:29 AM
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
Philip M
02-02-2009, 07:34 AM
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