eTianbun Posted April 22, 2012 Share Posted April 22, 2012 (edited) Am just trying to GET a TXT/XML file in my local system using AJAX, but i keep geting the error: " Access denied!" any idea why?EXAMPLE x = new XMLHttpRequest; y=x.open('GET','file.xml',true); //ERROR: Access denied! Edited April 22, 2012 by eTianbun Link to comment Share on other sites More sharing options...
Ingolme Posted April 22, 2012 Share Posted April 22, 2012 It sounds like you're working on the local filesystem with Internet Explorer. Use a different browser, or call the script through HTTP. Link to comment Share on other sites More sharing options...
eTianbun Posted April 22, 2012 Author Share Posted April 22, 2012 (edited) IE, Yeah! I used firefox, i got an error, but the error is not clear, it is just a sequence of characters which is not clear. Edited April 22, 2012 by eTianbun Link to comment Share on other sites More sharing options...
Ingolme Posted April 22, 2012 Share Posted April 22, 2012 Firefox will show something in the error console if the document you're loading is not XML but you can ignore that. Besides the error, is the program doing what you want it to? Link to comment Share on other sites More sharing options...
eTianbun Posted April 22, 2012 Author Share Posted April 22, 2012 Not doing what i want! Link to comment Share on other sites More sharing options...
Ingolme Posted April 22, 2012 Share Posted April 22, 2012 Can you show your code or an online page that has the problem? Describe what the expected result is and what the code is currently doing. Link to comment Share on other sites More sharing options...
eTianbun Posted April 23, 2012 Author Share Posted April 23, 2012 Acually, the code i gave, is all. Am just testing the xmlhttp object, to see how it really works. Can you please try it, using IE8, and tell me if you have same problem? This is confusing. Link to comment Share on other sites More sharing options...
Ingolme Posted April 23, 2012 Share Posted April 23, 2012 As I said earlier, Internet Explorer gives security errors when run in the filesystem. Try it on a server and it should work. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now