www.webdeveloper.com
Results 1 to 2 of 2

Thread: Javascript file referencing

Hybrid View

  1. #1
    Join Date
    Oct 2004
    Posts
    11

    Exclamation Javascript file referencing

    Hi,

    I believe this is a simple problem however I am not the best at javascript.

    First of all I started with the following:
    Code:
    <a href="\\SERVER-01\folder\file.xls" target="_blank">
    however this opens the XLS file in a web browser.

    So I then created a function called "RunFile"

    so when I do the following it works fine:
    Code:
    <a href="#" onclick="RunFile('G:/Server/folder/file.xls');">Click me</a>
    However my problem is that the "G" drive is mapped. So when I try:
    Code:
    <a href="#" onclick="RunFile('\\SERVER-01\folder\file.xls');">Click me</a>
    it does not work. There is nothing wrong with the mapping so I am assuming I must have to use the "file://" prefix in some manner? I have tried various alternative to no avail.

    Regards,

    jmcall10

  2. #2
    Join Date
    Aug 2008
    Location
    Sweden
    Posts
    227
    Have you simply tried this:
    Code:
    <a href="#" onclick="RunFile('file://SERVER-01/folder/file.xls');">Click me</a>
    I'm not completely sure it'll work... Perhaps you should post your RunFile() function as well?

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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



Recent Articles