?
Solved

jquery POST request to asp page returns Forbidden

Posted on 2008-11-16
6
Medium Priority
?
2,539 Views
Last Modified: 2012-05-05
I have a page which looks to populate a table with data by way of a jquery XmlHttpRequest.  I do a POST to an classic ASP page.  I am working locally and the page I am posting to is in the same directory.  I had this working perfectly in IE and Firefox.  At some point here it stopped working Firefox altogether.  Using fire bug I can see my post working fine but now the returned response is
"<body><h2>HTTP/1.1 403 Forbidden</h2></body>"

I've eliminated the connection to the Access database as an issue.
I've eliminated all the asp code on the page I am posting to as being faulty.
I am at this point "Forbidden access" to the ASP page all together.
While it was working fine before now it works only in IE and not in firefox.

I have no idea why. I've included the jquery code that makes the post -pretty straight forward.  The asp page, for testing, just returns a line of text so I won't post any code there.

Thoughts?


function post_forList(userID){
		$.post("listJSON.asp", {"userID":userID},callback_list, "json");
		alert("List received");
		}
 
	function callback_list(data){
		listResponse = data.success;
		alert(listResponse);
	}

Open in new window

0
Comment
Question by:colonialiu20
  • 4
  • 2
6 Comments
 
LVL 18

Expert Comment

by:ChetOS82
ID: 22977500
What happens if you to listJSON.asp in your browser?

This can be several things, first I would check the security on the file itself to make sure it can been read by the IUSR_machinename user.
0
 

Author Comment

by:colonialiu20
ID: 22981675
- If I run listJSON.asp in the browser the page runs as it should and outputs the appropriate response.
- FYI even if that ASP page is nothing more than a response.write("whatever") I still get a FORBIDEN when doing my jquery request.
- It's not a rights issue with the file. Going as far as giving the user EVERYONE full rights I get the same results.
- Also since it works in IE but not Firefox I'm not sure how it could be a rights issue.
- I uploaded it to a my webhost yielding the same results.

I have no idea here and am still open to thoughts.
0
 

Author Comment

by:colonialiu20
ID: 22981919
I have to believe this is a server problem at this point.  It was working just fine for two whole weeks!!  I can only think maybe my automatic updates installed something and messed things up.  But even if that is the case it still doesn't solve my problem.
0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Accepted Solution

by:
colonialiu20 earned 0 total points
ID: 22991289
OK, the simplest answers are always the most frustrating.  I took my code to work and it worked just fine.  I realized and confirmed the problem was Firefox at home.  I didn't realize I still had Firefox 2.0.  Apparently my Firefox 2.0 took a new update in the last week which caused Firefox to be unable to execute an ASP page.  I'd point this out to Mozilla that would be pointless to fix and updating to 3.0 just makes sense.
0
 
LVL 18

Expert Comment

by:ChetOS82
ID: 22993902
That doesn't make sense.  The IIS server should never be sending the plaintext of the asp file.  It has nothing to do with the browser.  Perhaps you were trying to access the file by file:// rather than http:// or something.

It is fine to close the question, I am just saying that the solution doesn't make sense.
0
 

Author Comment

by:colonialiu20
ID: 22994159
Perhaps I didn't describe the scenario well enough. IIS didn't send the plain text of the asp page back.  Only when I used IE did the ASP code get processed and a valid response get generated.  When firefox accessed the ASP page directly it worked fine as well.  But when I made an XmlHttpRequest to the ASP page using Firefox 2.0 the response was always ""<body><h2>HTTP/1.1 403 Forbidden</h2></body>"" regardless of what code was in the ASP page itself.  If I didn't have any code in the ASP page I would still get a forbidden response.  

This forbidden response had to be an IIS response forbidding me to even access the asp page.  I believe "somehow" Firefox 2.0 is specifically denied access to execute an ASP page through an XMLHttpRequest POST.

It has to be that as it worked fine before, started failing after a browser update, and now works fine since I changed to 3.0.

Hope that helps a little to understand.  Thanks for your thoughts.
0

Featured Post

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Requirements JQuery 1.6+ HTML CSS Introduction This article was inspired by an EE question (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/Q_28372511.html) on how to make a page show some balloons animate up a page…
In this article you'll learn how to use Ajax calls within your CodeIgniter application. To explain this, I'll illustrate how to implement a simple contact form to allow visitors to send you an email through your web site.
The viewer will learn how to dynamically set the form action using jQuery.
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
Suggested Courses
Course of the Month15 days, 15 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question