use the jquery object. The load () method is useful for loading data from the server through an AJAX request and placing the returned data directly into the specified element. This method is very simple to use and greatly simplifies the Ajax development syntax: jquery objects. Load (URL, param, callback), URL Access server address param send to server parameter callback execute callback function after normal return note: If Param is present, request as post, if Param does not exist, request it in get mode Example1, basic use<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >function Test () {//sends an AJAX request and assigns the returned response result directly to the Div$ ("#mydiv"). Load ("Servlet/test1", {"str": "You're Fine", "str2": "You're Bad"}); }</script>2, callback use<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >function Test () {//sends an AJAX request and assigns the returned response result directly to the Div$ ("#mydiv"). Load ("Servlet/test1", {"str": "You're Fine", "str2": "You're Bad"},function (data) {//What's inside the callback functionalert (data); }); }</script>Note: The callback function executes after the load has populated the data
Project code Example:
function Loadlastinfo (detail) { $ (// Call the Load method to load the selected data into the form, very convenient CustomerCommisonType:detail.customerCommisonType, CustomerCommison:detail.customerCommison, otherpay: Detail.otherpay, otherPay01:detail.otherPay01, otherPay02:detail.otherPay02, otherPay03: Detail.otherpay03, otherPay04:detail.otherPay04, otherPay05:detail.otherPay05, otherPay06: DETAIL.OTHERPAY06, otherPay07:detail.otherPay07, otherPay08:detail.otherPay08, otherPay09: Detail.otherpay09, otherPay10:detail.otherPay10, otherPay11:detail.otherPay11, otherPay12: Detail.otherpay12, IsAudit:detail.audit, isPriority:detail.isPriority, remarks:detail.remarks });}
JQuery Load method echo data