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 8653369
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T14:31:31+00:00 2026-06-12T14:31:31+00:00

Curious if anyone knows what the difference is in regards to the data parameter.

  • 0

Curious if anyone knows what the difference is in regards to the data parameter.

I have a $.post method that takes a $('#myform').serialize() as my data param and works.

If I try the same using the $.ajax() approach, it doesn’t work as my data param doesn’t appear correct.

Does anyone know the difference and what I might use instead of the above .serialize?

  • 1 1 Answer
  • 0 Views
  • 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-06-12T14:31:32+00:00Added an answer on June 12, 2026 at 2:31 pm

    After re-reading some online documentation, I decided to stick with $.post over $.ajax.

    The $.ajax method’s data param does something different than the $.post method does, not sure what exactly, but there is a difference.

    The only reason I wanted to use $.ajax is because I wanted to be able to handle events and didn’t realize I could do so with $.post.

    Here is what I ended up with

    function GetSearchItems() {
        var url = '@Url.Action("GetShopSearchResults", "Shop", New With {.area = "Shop"})';
        var data = $("#ShopPane").serialize();
        // Clear container
        $('#shopResultsContainer').html('');
        // Retrieve data from action method
        var jqxhr = $.post(url, data);
        // Handle results
        jqxhr.success(function(result) {
            //alert("ajax success");
            $('#shopResultsContainer').html(result.ViewMarkup);
        });
        jqxhr.error(function() {
            //alert("ajax error");
        });
        jqxhr.complete(function() {
            //alert("ajax complete");
        });
    
        // Show results container
        $("#shopResultsContainer").slideDown('slow');
    }
    

    JQuery 3.x

    The jqXHR.success(), jqXHR.error(), and jqXHR.complete() callback
    methods are removed as of jQuery 3.0. You can use jqXHR.done(),
    jqXHR.fail(), and jqXHR.always() instead.

    var jqxhr = $.post(url, data);
    // Handle results
    jqxhr.done(function(result) {
        //alert("ajax success");
    });
    jqxhr.fail(function() {
        //alert("ajax error");
    });
    jqxhr.always(function() {
        //alert("ajax complete");
    });
    

    https://api.jquery.com/jquery.post/

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

Sidebar

Related Questions

I was curious if anyone knows of any good examples of plugins that I
I'm curious if anyone knows of any frameworks that enable asynchronous multiplayer gaming in
Quite curious, but was just wondering if anyone knows the difference between using: System.Windows.Forms.SaveFileDialog
I have a web service method that takes a network login (string) as a
Curious if anyone knows (or can easily test) the time it takes to reference
I'm curious if anyone knows of any downloadable Objective C sample code for the
I'm curious if anyone knows of a way to easily get a double border
I am curious to know whether anyone out there have tried mixing node.js headless
Just curious if anyone knows of good sites for learning and understanding PyGame. I've
I am curious if anyone knows if it is possible for a single portlet

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.