<!DOCTYPE html> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> <title>JQuery ajax</title> <script type="text/javascript" src="jquery.min.js"></script> <script type="text/javascript"> $(document).ready(function() { var comment = $('#comment'); $('#refresh').click(function() { dynamicData('comment'); }); function T2(res) { alert(res); } function dynamicData(param) { $.ajax({ type : 'POST', url : '/post.asp', data : 'name=12', cache:false, success : function(result) { T2(result); } }); } }); </script> </head> <body> <input type="button" id="refresh" value="test" /> <div id="comment"></div> </body> </html>