Go Back   Velocity Reviews > General Computer Discussion > Software
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Search this Thread
Old 02-25-2009, 06:51 PM   #1
Default javascript relative path to load xml file


The file/folder structure is like
root/one/index.htm
root/one/files/images/picture.jpg

root/two/index.htm
root/two/files/images/pict888.jpg

root/shared/files/js/test1.js
root/shared/files/xml/datafile.xml
.
.
The index.htm files in folder one and two has reference to .js file -----

<script src="../shared/files/js/test1.js" type="text/javascript"></script>


in head section. That is simple.

.

Now the .js file has code to open xml file as follows:

xmlDoc=new ActiveXObject("Microsoft.XMLDOM");
xmlDoc.async=false;
xmlDoc.load("path");
QUESTION 1 what this path could be?
.
.
.
.
there are pictures on index.htm in one and two which come from respective files/images folders, but their path is obtained from .xml file
<row1 id="1" imageurl="imagepath" rowtitle="title">desctiption test</resrow>
QUESTION 2 what this imagepath could be?
.
.
.
QUESTION 3 For the above file/folder structure do path and imagepath change depending its on location - local machine or web server?



Thanks


torontodesi
torontodesi is offline   Reply With Quote
Old 02-26-2009, 06:15 AM   #2
susith
Junior Member
 
Join Date: Feb 2009
Posts: 20
Default
JavaScript are executing on web browser. So all paths should access outside (web browser) and relative to web server.

I assume you can reach index.htm from localhost/one/index.htm

1. So you must put relative path from there files/xml/datafile.xml
and xml file should accessible from localhost/one/files/xml/datafile.xml

2 as same as above files/images/picture.jpg

3. relative to web server (webapp)


susith
susith is offline   Reply With Quote
Old 02-26-2009, 01:13 PM   #3
torontodesi
Junior Member
 
Join Date: Feb 2009
Posts: 3
Default
Thanks....


torontodesi
torontodesi is offline   Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Javascript not firing becasue of Response.Redirect CorpAmis Software 1 04-30-2009 07:46 AM
navigator.browserLanguage --JavaScript cauzon Software 0 12-28-2007 05:33 AM
How to assign a returns value of a javascript function to a hiddenfield in a webpart Chander Software 0 12-20-2007 09:14 AM
Values set by javascript are not reflected in serverside(.Net) rchimakurty Software 2 11-28-2007 10:07 AM
problem with javascript dootam Software 1 07-10-2007 06:38 AM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46