![]() |
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">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>Code:
<a href="#" onclick="RunFile('\\SERVER-01\folder\file.xls');">Click me</a>Regards, jmcall10 |
What code do you have in RunFile()
|
A backslash in a JavaScript string indicates that the next character designates some special meaning. e.g., \n means newline. \t means tab. And so on.
This is true EVEN IF the character after the backslash is NOT special: In that case, the backslash is just ignored. So to actually *use* a backslash in a string, you must use TWO of them: Code:
<a href="#" onclick="RunFile('\\\\SERVER-01\\folder\\file.xls');">Click me</a> |
| All times are GMT +1. The time now is 03:47 AM. |
Powered by vBulletin®
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.