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 SinghRank #669 · 3.6K reputationPosted May 1, 2011, 4:23 AM EDT
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 SinghRank #669 · 3.6K reputationPosted May 1, 2011, 1:13 AM EDT
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 :)
Majid KamaliRank #6,453 · 266 reputationPosted May 1, 2011, 4:04 AM EDT
Here's my code:
AJAX
And here's textFile.txt:
Hello user. This is a text from server.
What's the problem?
Thanks
CrishRank #1,486 · 1.1K reputationPosted May 5, 2011, 4:42 AM EDT
I try this code which mention here but it is not working .
plz help me.
Ravishankar SinghRank #669 · 3.6K reputationPosted May 5, 2011, 8:53 AM EDT
Could you please share your code so that I can tell where you did mistake?(If you dont mind) :)