Reputation:
I'm having trouble with some Javascript where it can not access an XML file in the parent directory. It can access the same file if it is in the same directory as the page.
xmlhttp.open("GET", "news.xml", false); // = Works! (if I copy the XML file in the same folder)
xmlhttp.open("GET", "random/news.xml", false); // = Works!
xmlhttp.open("GET", "../news.xml", false); // = Doesn't work!*********
I cannot seem to find any rules against parent directories while Googling...is there something that's missing here?
Upvotes: 1
Views: 1632
Reputation: 388416
It is not permissible under Same Origin Policy.
Since you are accessing a local file, using XmlHttpRequest you can open a file which is in the same directory.
Firefox allows access files in one of the sub directories of the directory in which the main file resides.
Upvotes: 2