Solved

open a windows application with javascript from Mozilla, Firefox or Netscape

Posted on 2004-09-13
7
975 Views
Last Modified: 2008-01-09
Background - problem to be solved:
Client wants a particular excel spreadsheet to open from a local HTML page (link, button or automatically)
e.g. open (fixed path and name on local windows network share) \\server\share\path\file.xls from file://///server/share/path/start_here.html.  

IE is not an option.

Can I do this with javascript?, if so how? If not, can you suggest an alternative that is low- to no-maintenance.  All machines have current Java environment on them.  WSH is not available.
0
Comment
Question by:santa_0
  • 3
  • 2
  • 2
7 Comments
 
LVL 63

Accepted Solution

by:
Zvonko earned 400 total points
ID: 12047266
A simple anchor link will do it.
Here is my example for your start_here.html:
<html>
<body>
<a href="file.xls ">Excel</a>
</body>
</html>

The user get asked when clicking on the "Excel" link: () "Open with default application (Excel)"
0
 
LVL 8

Assisted Solution

by:inq123
inq123 earned 100 total points
ID: 12047300
Hi santa_0,

Why don't you just use

<a href="file://///server/share/path/file.xls">load xls file</a>

or even just

<a href="file.xls">load</a>

because the html is in the same directory as xls file.  You could also stream the file over, but why bother?

Cheers!
0
 
LVL 8

Expert Comment

by:inq123
ID: 12047312
oops, Zvonko beats me to it. :)
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 

Author Comment

by:santa_0
ID: 12048767
Thanks for the replies.  Zvonko gets the points.  In actual fact, I decided on a button since there was another step in the process, and the buttons for the two steps seemed more logical to the end users.

ftr here's what I did.  I used the javascript so the filename would be more easily changed later:

<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="content-type">
<title>Title of Page</title>
// set up a "variable" so that we can fix the file location when someone moves or renames the file
// nb -- the path is reference in the body in some text, too
<script language="JavaScript">
function theFile() {
window.location= 'file://///server/share/path/file.xls';
}
</script>
</head>
<body>
<center>
<br>
<big><big><big style="color: rgb(255, 0, 0);">Remember to check the
list!</big></big></big><br>
This page needs the list to be:<br>
\\server\share\path\file.xls <br>
<br>
<input onclick="theFile()" value="Open the list (w/Excel)" type="button">
<p><br>
</p>
<input onclick="location.href='http://www.google.com" value="do the next step" type="button">
</center>
</body>
</html>
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 12048855
Thanks for sharing your solution here.
But why the grading B?
It does not cost you more to give an A and experts get less points with grading B.
My recommendation is to give B only when you get disappointed by the experts.

If you want to do me a favor, then please ask Community Support to release this question again so you can split the points fifty-fifty with an A.
Here the link to CS TA: http://www.experts-exchange.com/Community_Support/

Cheers,
Zvonko

0
 

Author Comment

by:santa_0
ID: 12093746
I gave a B because I couldn't find the grading tips, and I needed to move on.  So I guessed.  "A" is usually reserved for extra or outstanding effort (for example, solution for link AND button AND auto-execute).   After finally locating the FAQ with the grading tips, I still think the description for B pretty clearly matches my situation.  But I do note the discussion about grade inflation a little further on from there, and that I have probably been too stingy.  

Now, this is my first post here, but after doing the arithmetic, (http://www.experts-exchange.com/Community_Support/help.jsp#hi20) I think I'll decline your request to re-arrange the points, since that would reduce your points from 1200 to 1000, and it's just not worth the effort and cost to increase inq123's when he didn't request it (and after this much poking about in the bowels or E-E, it *really* won't be worth it). :^)

BTW these are the grading guidelines I relied upon:
http://www.experts-exchange.com/Community_Support/help.jsp#hi73

I will keep your recommendation in mind for the next question.

Thanks again for the tip!
d.
0
 
LVL 63

Expert Comment

by:Zvonko
ID: 12094819
First of all: I have enough points ;-9
Second: I succeeded in my goal making you sensible for Expert's point of view ;-)

Cheers,
Zvonko
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Avoid defining the variables in the global scope; trying to define them in a local function scope. Because:   • Look-up is performed every time a variable is accessed.   • Variables are resolved backwards from most specific to least specific scope…
This article demonstrates how to create a simple responsive confirmation dialog with Ok and Cancel buttons using HTML, CSS, jQuery and Promises
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now