views:

653

answers:

2

Hello:

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(?...))?

Thank you,

DFM

+1  A: 

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

Daniel A. White
Thanks Daniel - After reviewing the article, I fouhnd the correct syntax to be file://///Server-1/Folder-1/Folder-1. What is interesting is that this also works in IE so I do not have to write if statements.Thanks again,DFM
A: 

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.

pageman
Thanks Pageman - I actual found the correct syntax from the artical, which requires 5 slashes at the beginning and 1 per folder.Thank you,DFM
@DFM who would have thought? you needed one more slash! :) or rather, two! :)
pageman