DO YOU NEED A CONTENT WRITER FOR YOUR BUSINESS?

Your One-Stop Solution for All Content Needs! Click here for more!
Categories: jQuery

jQuery post() Method – load data from the server

Share

jQuery post() Method loads data from the server using a HTTP POST request.

Syntax:

$(selector).post(URL, data, function(data,status,xhr), dataType)

Example of jQuery post():

$.post( "ajax-master.php", function( data ) {
$( "#result" ).html( data );
});

The above example fetches the requested HTML snippet and inserts it on the page based on ID.

Read also: Abort Ajax requests using jQuery

To ignore a result, you can use below code:

$.post( "ajax-master.php" );

You can pass additional parameters there also as below:

$.post( "ajax-master.php", { name: "John", age: "25" } );

You can pass arrays of data to the server as below:

$.post( "ajax-master.php", { 'name[]': [ "Hanse", "jane" ] } );

See jQuery reference for more details.

Namaste UI

For any types of queries, you can contact us on info[at]namasteui.com.

Recent Posts

Top Brand Promoter Agency in India | Increase Retail Sales by 40%

Very few brands suffer from a product issue. It's a conversion issue. People enter DMart,…

4 days ago

Retail KYC Collection & Verification Services in India | Fast & Compliant

The onboarding process of the retailer, distributor, or partner may soon become problematic if there…

4 days ago

All You Need to Know about Low THC Oil Registry Card Georgia

Many of the states in the United States of America allow the use of medical…

2 weeks ago

Easy Ways to Strengthen Online Security and Privacy

Did you know that every time you browse this website or any other, you leave…

2 weeks ago

Play Anytime, Anywhere with GameZone Arcade Games

Online casino has gained immense popularity with the rise of online casinos. Platforms like GameZone…

2 weeks ago

Need to rank for seasonal keyword?

Every business has one or several peak seasons or periods of time during the year…

2 weeks ago