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

Edge Computing vs Cloud Computing: What’s the Difference?

Let’s face it. Tech buzzwords get thrown around a lot—especially when it comes to how…

3 days ago

How Data Intelligence Shapes the Future of Digital Innovation

In today’s digital world, the boundaries between technology, finance, and innovation are rapidly disappearing. Businesses…

6 days ago

How To Power Your Backyard Parties with A Solar Power Battery?

Backyard gatherings like BBQs, family reunions, and garden parties are an exciting way to enjoy…

7 days ago

5 Best Practices for Programmatic Advertising

Marketers are always on the lookout for more effective ways to reach their target audiences.…

7 days ago

Are We All Addicted to Stimulation? The New Face of Anxiety Disorders

Does your phone control your mind more than you control your phone? Modern life exploits…

1 week ago

What Lifestyle Changes Help Prevent BPH from Coming Back

Did you know that the prostate continues growing throughout a man's entire life, making BPH…

1 week ago