Home
<!DOCTYPE html> <html> <head> <meta name="viewport" content="width=device-width" /> <script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.2/jquery.min.js"> </script> <script type="text/javascript"> $(document).ready(function () { $('#loadBtn').click(function(){ $('#msgDiv').load('/jquery/getdata', // url { name: 'bill' }, // data function(data, status, jqXGR) { // callback function alert('data loaded'); }); }); }); </script> </head> <body> <h1> jQuery post() method demo </h1> <input type="button" id="loadBtn" value="Load Data" /> <div id="msgDiv"></div> </body> </html>
Result: