HTML:
<script>
/*
$(document).ready(function(){}
页面加载事件,加载完页面之后执行
*/
$(document).ready(function(){ /* alert("aa"); $.ajax({ type: "post", url: "/dgm/toborrow", data:{id :'10'}, success: function (data) { console.log(data) } });*/ loadFormData(); }); function loadFormData(){ // alert(123); $.ajax({ type: "post", url: "/dgm/toborrow",/*访问controller路径*/ data:{id :'10'}, success: function (data) { console.log(data) $('#toborrow').val(data.NAME); $('#telephone').val(data.TELEPHONE); $('#legalperson').val(data.LEGALPERSON); } }); } </script>
注意: