This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes HTML, CSS and JavaScript and the fly likes Activex xmldom nightmare Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "Activex xmldom nightmare" Watch "Activex xmldom nightmare" New topic

Activex xmldom nightmare

Graham VMead
Ranch Hand

Joined: Sep 22, 2003
Posts: 154
Hi I'm relatively new to Javascript but I wonder if someone can help

I've got a JSP generated HTML page (using struts) with embedded Javascript. In the javascript I'm trying to load an XML file using ActiveX e.g

mydom = new ActiveXObject("microsoft.xmldom");

I'm having a mare of a time trying to specify the file location.
As far as I'm aware the javascript will be running on the client.

1) Is there a concept of a "current" directory, if so how do I find out what on earth it is (maybe via javascript)!!! I've tried one solution on the net "window.location.href" but all that gives me is the URL to the JSP not the local location (if there is one);

2) What form should the "locationtofile" take, can it be relative to a current directory or does it have to be absolute???

TIA Graham
[ October 12, 2005: Message edited by: Graham VMead ]
Eric Pascarello

Joined: Nov 08, 2001
Posts: 15376
Linking to the XML file is the same as linking to an image, external js file, css file, another page etc. So all the same rules apply.

I agree. Here's the link:
subject: Activex xmldom nightmare
Similar Threads
File Uploading Problem !!
Relative directory issues
How to reload a page after commiting the response with an outputstream ?
Get Visiting Users Windows User Name
Validate file size before uploading to server