Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 656073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:40:27+00:00 2026-05-13T22:40:27+00:00

i am trying to test jquery post. I am posting a form and want

  • 0

i am trying to test jquery post. I am posting a form and want to update in ajax and replace with a success form over a div (seems like a common use case).

The following code works fine in firefox but not in IE.

One issue is that from Firefox Request.IsAjaxRequest() is true but coming from IE, Request.IsAjaxRequest() is returning false

NOTE: i put in the Thread.Sleep in my controller action just as a test to make sure i can see whats going on.

Here is my view code:

 <div id="contact">
   <form action="/Tracker/Add" method="post">
    <fieldset id="inputbox">
       <p>

        <label>Today's number</label>   <input class="inputText" id="weight" name="weight" type="text" value="208" /></p>
        <p><label>Today's Date</label>     <input class="inputText" id="datepicker" name="date" type="text" value="03-Mar-2010" /></p>
        <p><input type="submit" value="Enter" /></p>
    </fieldset>

and here is the javascript / jquery code:

<script type="text/javascript" src="../../Scripts/jquery/1.3.2/jquery-1.3.2.min.js"></script>

 <script type="text/javascript">
    $(document).ready(function() {
    $('#contact form').live('submit', function() {

            //$("#Loading").fadeIn(); //show when submitting

            $.post($(this).attr('action'), $(this).serialize(), function(data) {
                $("#contact").replaceWith($(data));
            });
            return false;
        });
    });
</script>

and here is my controller action:

    public ActionResult Add()
    {
         if (if (Request.IsAjaxRequest())
         {
                  //firefox will hit this but IE wont
          }


        Thread.Sleep(5000);
        return PartialView("EntryView", new MyViewModel());
    }
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:40:28+00:00Added an answer on May 13, 2026 at 10:40 pm

    I verified that your code (in which I was unable to find an error) was not sending an XHR request with jQuery 1.3.2 and IE 6.0.2900.5512; upgrading jQuery to the next available version, 1.4.0, fixed the broken behavior. With 1.4.0 (and above), IE posts the form using AJAX and sends the X-Requested-With header required for IsAjaxRequest() to work. Are you able to upgrade jQuery? I didn’t have any luck finding the specific bug/fix for this, but if you need to stick with 1.3.2, I can keep digging.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to submit a form using jQuery's .ajax() function. It seems like
I'm trying to update a div with an ajax post. Problem is...it's updating every
I am trying to test the jQuery Address Plugin and it seems to not
So Im trying to use jquery's .post function to submit a form and return
I am trying to use jQuery to make a synchronous AJAX post to a
I'm trying to access a 3rd party api over http using jquery .ajax (or
I'm trying to pass user input form data jquery/ajax to check if there's any.
I'm trying to make a post request via ajax using jQuery (for the BaseCamp
I am trying to post some form data to self with no success.My code
I am trying to test an API via AJAX. I have used JQuery: $(document).ready(function(){

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.