jQuery Ajax post Method
home
Run
screen_rotation
fullscreen
cloud_download
<!DOCTYPE html> <html> <head> <title>jQuery Demo example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $( "#ajaxExample" ).on( "click", function(event) { var uri = 'http://runtest.tutorialsplane.com/php/'; var firstName = $("#fname").val(); var lastName = $("#lname").val(); $.post(uri+"post_method_demo.php",{firstName,lastName},function(response,status){ alert("Status = "+status+" Response = "+response); }); }); }); </script> <style> .myClass{ border:4px solid red; background:yellow; width:400px; height:300px; padding:10px; } </style> </head> <body> <h4 >Load Data from Server Using Ajax $post() Method </h4> <div id="myDiv" > <form name="myForm" id="myForm" action="javascript:void(0);"> <input type="text" name="fname" id="fname" value="first name"><br><br> <input type="text" name="lname" id="lname" value="last name"><br><br> <input type="button" name="submit" id="ajaxExample" value="Submit Me Using Post Method"> </form> </div> </body> </html>
<!DOCTYPE html> <html> <head> <title>jQuery Demo example</title> <script type="text/javascript" src="http://code.jquery.com/jquery-2.1.4.min.js"> </script> <script type="text/javascript"> $(document).ready(function(){ $( "#ajaxExample" ).on( "click", function(event) { var uri = 'http://runtest.tutorialsplane.com/php/'; var firstName = $("#fname").val(); var lastName = $("#lname").val(); $.post(uri+"post_method_demo.php",{firstName,lastName},function(response,status){ alert("Status = "+status+" Response = "+response); }); }); }); </script> <style> .myClass{ border:4px solid red; background:yellow; width:400px; height:300px; padding:10px; } </style> </head> <body> <h4 >Load Data from Server Using Ajax $post() Method </h4> <div id="myDiv" > <form name="myForm" id="myForm" action="javascript:void(0);"> <input type="text" name="fname" id="fname" value="first name"><br><br> <input type="text" name="lname" id="lname" value="last name"><br><br> <input type="button" name="submit" id="ajaxExample" value="Submit Me Using Post Method"> </form> </div> </body> </html>
Copyrights@tutorialsplane.com