McCh!cken
2010-01-02 15:29:30 UTC
The HTML that uses my jQuery function is in [html] and the xml is in [xml] directory. The tree:
[html]
-> here is my html file; to access the xml doc: "../xml/myDoc.xml"
[xml]
-> and here is my xml
So I tried file:///... access, absolute url, hasn't worked either...
I can't put my [xml] directory in the [html] one, due to certain reasons.
My jQuery function:
function workXML(xmlFile,mode,data) {
$(document).ready( function(){
$.ajax( {
type: "GET",
url: xmlFile,
datatype: "xml",
success: function(xml) {
alert("jó");
if (mode == "fill") {
fillHTML(xml,data);
addImages(xml,data);
} else if (mode == "cur") {
fillCur(xml,data);
} else if (mode == "pagedata") {
getPageData(xml,data);
} else if (mode == "getdata") {
return getXMLdata(xml,data);
} else if (mode == "link") {
alert("jó");
return Link(xml,data);
} else {
$("body").append("
Hibás workXML() mode érték!
");}
}
});
});
}
At the fifth row, I should declare the path of my xml doc, but it doesn't work, the success function does not run.
Have you got any idea how I can keep my directory tree while I can access my xml?
(As I have mentioned the source of the problem is the url, more accurately, the "../".)
Thanks in advance.