Javascript examples for jQuery Method and Property:ajax
render POST response
<html> <head></head> <body> <div id="content"></div> <script type="text/javascript" src="https://code.jquery.com/jquery-1.12.4.min.js"></script> <script> $.ajax// w ww . j av a2s. co m ({ type: "POST", url: "http://localhost:8080/example", data: { messageid: 1}, dataType: "json", cache : false, success: function (data) { $('#content').text(data.message); }, error: function (err) { console.log(err); } }); </script> </body> </html>