Link to home
Start Free TrialLog in
Avatar of colonialiu20
colonialiu20Flag for United States of America

asked on

jquery POST request to asp page returns Forbidden

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

Avatar of ChetOS82
ChetOS82
Flag of United States of America image

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.
Avatar of colonialiu20

ASKER

- 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.
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.
ASKER CERTIFIED SOLUTION
Avatar of colonialiu20
colonialiu20
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
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.
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.