Reputation:
I recently built a HTML and Javascript web application that opens specific folders throughout a network of accessible drives. This app works well when it is rendered in IE; however, the folder paths do not work in FireFox.
The following is an example of the path format that I am using to open the folders in IE:
{
window.open('\\\\Server-1\\Folder-1\\Folder-2');
}
The path actually has 4 backward slashes at the beginning and 2 bakcward slashes between each folder. It appears different when rendered.
When I run this app in FireFox, the window or new tab appears, but there is nothing rendered. I've manually entered the path and FireFox converts it to: file://///Server-1/Folder-1/Folder-2
. Does anyone know what the correct syntax would be (i.e. window.open(?...)
)?
Upvotes: 1
Views: 10778
Reputation: 3022
according to Daniel's link you need THREE forward slashes not FOUR for local paths...
Path Syntax
You also need to use proper URI syntax for local file references. It is not proper to enter an operating-system-specific path, such as c:\subdir\file.ext without converting it to a URI, which in this case would be file:///c:/subdir/file.ext. In general, a file path is converted to a URI by adding the scheme identifier file:, then three forward slashes (representing an empty authority or host segment), then the path with all backslashes converted to forward slashes.
Upvotes: 1
Reputation: 190935
Here is something that might help you. It is considered a security risk by Mozilla.
http://kb.mozillazine.org/Links_to_local_pages_do_not_work
Upvotes: 1