Save and display Basic Information
The information entered on the page is generally associated with the backend server. Because the input information needs to be saved, the information needs to be obtained from the server during browsing.
The validation conditions of the confirm button will not be discussed anymore. The following is a direct attachment to the Code in the confirm where all information is entered in the correct else format.
Save information:
$. Ajax ({url: config. baseServerUrl + '/account/customer/houseInfo/save', type: 'post', data: {// The parameter houseStatus: $ conditionSlt submitted to the server (interface. val (), housePay: $ ("# housePay "). val (), customerId: customerId, pro: $ provinceSlt. text (), city: $ citySlt. text (), county: $ areaSlt. text (), addrDetial: $ ("# detail "). val ()}, success: function (data) {// The returned message console. log (data); if (data. success) {alert ("saved successfully! "); Window. location. href =" http: // 192.168.220.55/page/AmountAscension/basicInfo/basicInfo.html ";}else {return false ;}}})Display Information:
Var customerId = sessionStorage. customerId; // the user ID can be used at any time. $ (function () {$. ajax ({url: config. baseServerUrl + '/account/customer/info', type: 'get', data: {customerId: customerId}, // The parameter success: function (data) {console. log (data); // print the data if (data. success) {// work information var work = data. attr. workInfo; // obtain and assign values to the data to display var workHtml = ''+''+ Work. job + ''+ work. organization +'
'+''+ Work. areaNo + ''+ work. phoneNo +'' + work. branchNo + ''+'
'+ Work. pro + ''+ work. city +'' + work. county +'
'+ ''+ Work. workDepartment +'' + work. position +''+''+ Work. industry + ''+ work. performanisescale +'' + work. classes +'
'; $ ("# WorkInfo"). append (workHtml); // Housing Information var house = data. attr. houseInfo; var houseHtml =' +''+ House. houseStatus + ''+ house. housePay +'
'+''+ House. pro + ''+ house. city +'' + house. county + ''+ house. addrDetial +'
'; $ ("# HouseInfo"). append (houseHtml );}}})})