I was learning ajax from w3schools.com and copied one of it's examples and paste it to a notepad, then saved it with html extension.
then I changed file names (url that will be retrieved) to one of text files in that folder.
But it creates "Access is denied" error in IE. FireFox does not even execute it.
What's the problem?
Thanks

Ravishankar SinghPosted May 1, 2011, 8:23 AM
Problem is here:
xmlhttp.open("GET","textFile.txt",false);
When you are calling "textFile.txt",its not finding the url from web.
for your more understanding.You can give any url and the file path e.g "http://sharepointwithravi.blogspot.com/p/about-me.html".
Otherwise do the following:
1.Create an Asp.net project.
2.In your default.aspx page should look like below code:
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="AjaxPage.aspx.cs" Inherits="AjaxPage" %>
3.Add new Item ,Select Textfile.Named as textFile.txt.
4.Run your code now.
Enjoy the coding :)
Ravishankar SinghPosted May 5, 2011, 12:53 PM
Could you please share your code so that I can tell where you did mistake?(If you dont mind) :)
CrishPosted May 5, 2011, 8:42 AM
I try this code which mention here but it is not working .
plz help me.
Majid KamaliPosted May 1, 2011, 8:04 AM
Here's my code:
AJAX
And here's textFile.txt:
Hello user. This is a text from server.
What's the problem?
Thanks
Ravishankar SinghPosted May 1, 2011, 5:13 AM
You are getting error because you have not added the url in open method
i.e
Replace xmlhttp.open("GET","ajax_info.txt",false); to xmlhttp.open("GET","http://www.w3schools.com/ajax/ajax_info.txt",false);
See the below example that I am showing you:
Let AJAX change this text
Now you continue your ajax learning,Happy coding :)