How to get the root directory for the java script code?
<p>In a HTML page, how do I discover the root directory using Javascript?</p>

<pre><code>var x = tinyMCEPopup.editor.getContent().toString();
$.ajax({
    url: '/TinyEditor/XML/PreviewBody.xml', //read xml
    type: 'get', //method type
    dataType: 'xml', //c
</code></pre>

<p>Look at the URL and I made changed in the jscript library and that exist in the <code>.html</code> page extension.
I have to hard code the above URl, the whole application is kept in the root directory TinyEditor on the server, in case this directory name is changed then, my code will be not function proper, that's why i need to find a way to get the root directory in a generalize way.
Got my point?</p>
