Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Path in javascript

Status
Not open for further replies.

dpalmond

Programmer
Jul 3, 2007
5
US
I have javascript on a web page in our intranet to read an xml file. When I code the path as follows things work fine:
var xmlObj1 = new XML(".\xml\esf_data1.xml");

because xml is a folder in the path this web page is in.

I need to move the file in the xml folder to a different path on the server so that the file esf_data1.xml can be read by another web page that also needs the same file. This other web page is an exact copy of the first, but in a different path. I moved esf_data1.xml to another folder named statusform on the server and coded the path as follows:

var xmlObj1 = new XML("\\docsql\statusform\esf_data1.xml");

When I run the form in the browser it errors because it can't find the xml file, yet I can copy this path to the run command and it opens my xml file. Does anyone know how I can code the path so two identical web pages in different paths can share the same xml file?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top