jQuery post() method loads data from the server using a HTTP POST request.
Requesting a URL
In the following example, we provide server-side coding for both PHP and Node.js, you can choose your favorite.
The following is the server-side coding using PHP.
<?phpecho"Hello User Welcome to ajax jquery";
The following is the server-side coding using Node.js.
res.send("Hello User Welcome to ajax jquery");
console.log("port is listening to 8000");
In the following client-side coding, we are not sending any data. Instead, we request a URL using jQuery post() method and receive a response.
HTML Online Compiler
<h1>jQuery post() Method</h1>
<p>Requesting url with no data using post() Method.</p>
<button>Send Post Request</button>