Resolve sibling folder in JavaScript Function

Posted by Jamen Chu on Stack Overflow See other posts from Stack Overflow or by Jamen Chu
Published on 2010-04-06T21:57:01Z Indexed on 2010/04/07 0:33 UTC
Read the original article Hit count: 391

Filed under:
|
|

Hi,

I am trying to pass into an JavaScript function two paths for an XML and XSLT. It would appear that in the sample HTML below that the use of "../xsl/filename" does not work for me in the xslt() function. If I specify the path as being "./filename" though this does work.

Does anyone know how I can work around this or find some way that I can specify a sibling folder without an absolute path reference? I would prefer not to have to change my file paths as my development environment is set up with the xslt's, sample data and source code structured in a particular way.

Thanks in advance Jamen

<html>
<head>
<title></title>
<script type="text/javascript" src="../lib/jsunit/app/jsUnitCore.js"></script>
<script type="text/javascript" src="../lib/jquery-1.2.3.js"></script>
<script type="text/javascript" src="../lib/jquery.xslt.js"></script>
</head>
<body>
<div id="bla"></div>
<script type="text/javascript">
$('#bla').xslt("../sampledata/response1.xml", "../xslt/resultFormatter.xsl");

//function testjQuery() {
//  $('#bla').xslt("../sampledata/response1.xml", "../xslt/resultFormatter.xsl");
//}
</script>
</body>
</html>

© Stack Overflow or respective owner

Related posts about JavaScript

Related posts about Xml