In order to retrieve data via ajax, we give it some parameter data like requestId, andn telNum, then it will return a data through a data parameter. In our case, it is data.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
$(document).ready(function(){ $.ajax({ url:'${rootPath}/circ/sabids.json', type: 'GET', data:{ 'requestId' : <%=requestId%>, 'telNum' : <%=telNum%> }, success:function(data) { if(data.isSuccess) { $("#title").val(data.callRequestResult.title); console.log('title+++++'+data.callRequestResult.title); //alert(data.callRequestResult.emergencyLevel) $('#emergencyLevel').val(data.callRequestResult.emergencyLevel); $('#content1').val(data.callRequestResult.content); if(null != data.OldPeopleInfo) { $('#code1').val(data.OldPeopleInfo.code); $('#oldmanName1').val(data.OldPeopleInfo.name); $('#gender1').val(data.OldPeopleInfo.gender); $('#mobilePhone').val(data.OldPeopleInfo.mobilePhone1); $('#address1').val(data.OldPeopleInfo.address); currentPeopleId = data.OldPeopleInfo.peopleId; } } //if }, //success }); // ajax }); //doc ready |