I have a link like so
Is there anyway with javascript to make this folder open when the link is clicked?Code:file:///Volumes/folder/name/
I already tried the window.open function, but its not working.
Thanks.
Printable View
I have a link like so
Is there anyway with javascript to make this folder open when the link is clicked?Code:file:///Volumes/folder/name/
I already tried the window.open function, but its not working.
Thanks.
Please don't cross-post. If you don't know whether to post in PHP or HTML, take your best guess and post in one section.
Anyway, you do this the same as any other link, but you need to specify a complete path beginning with the drive letter:
And of course it won't work if that exact folder doesn't exist.Code:<a href="file:///C:\Volumes\folder\name\">Click here.</a>
Sorry for the cross-post.
This doesn't work:
Is it possible that its a security issue which is being blocked by the browser?Code:<a href="file:///C:\Volumes\folder\name\">Click here.</a>
Quite probably, yes. The link works for me when used from a local page, but when uploaded to a remote domain, no longer works.
Edit: some Googling suggests that some OS/browser combinations have no trouble opening these types of links (from a remote site), but more modern configurations don't allow them (one person said it worked when they added their domain to "Trusted Sites" in IE). This makes sense to me, as linking to a local drive doesn't really make sense on a hosted web page anyway.
file URLs will only be resolved from pages served from file