jquery POST request to asp page returns Forbidden

Posted on 2008-11-16
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.


function post_forList(userID){

		$.post("listJSON.asp", {"userID":userID},callback_list, "json");

		alert("List received");


	function callback_list(data){

		listResponse = data.success;



Open in new window

Question by:colonialiu20
    LVL 18

    Expert Comment

    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.

    Author Comment

    - 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.

    Author Comment

    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.

    Accepted Solution

    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.
    LVL 18

    Expert Comment

    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.

    Author Comment

    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.

    Featured Post

    How your wiki can always stay up-to-date

    Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
    - Increase transparency
    - Onboard new hires faster
    - Access from mobile/offline

    Join & Write a Comment

    Introduction Chart.js, used properly, can visually add a difference to your charting applications. It engages your visitors and allows them to interact with data they otherwise wouldn't be able to without expensive and complicated systems. For this…
    Introduction JSON is an acronym for JavaScript Object Notation.  It is a text-string data transport mechanism, capable of representing simple or complex data structures in a consistent and easy-to-read manner.  Similar in concept to XML, but more e…
    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)

    732 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

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now