Frontend page jump and get value, page Jump
Record
(Jump to page B from page A and assign the value of page B to page A for display)
;)
This is page.
This is page B.
Click Add Log On page A to Go to page B, and upload the log Content added on page B to the red box on page.
// This is stored on page A // fill in the json data returned from the filled log to the customer details function DunnAge (data) {// data var data = JSON returned from page B after success. parse (JSON. stringify (data); var Remark = data. body. remark; // content var AddTimeStr = data. body. addTimeStr; var html = '<div class = "accessLog"> <div class = "val-log">' + Remark + '</div> <div class = "time-log"> '+ AddTimeStr +' </div> '; $ (". js_noJilu "). hide (); $ (". js_rizhi "). prepend (html)} <div class = "Detailss-btn js_openPage" data-url = "/OACustomer/AddLogView? Id = @ detail. Id "> Add log </div>
Configure the header in common js
(Detailed App header configuration instructions ---------- App configuration page header)
The header of page A "/OACustomer/CustomerDetail": {title: "Customer Details", headLeft: [{foreImage: "iconback", eventString: "gjj: // Close. page/1? JsCallBack = maid "}], headRight: [{foreImage:" icondrop ", type:" DropDownList ", menus: [{iconImage:" iconcontentchange ", alpha:" 100 ", text: "modify customer information", textSize: 16, textColor: "000000", backColor: "FFFFFF", eventString: "modiFicaTion ()"},],}]}, header of page B "/OACustomer/AddLogView": {title: "add customer log", headRight: [{text: "submit", eventString: "submit () "}]} // header configured in js
// This is stored on page B // submit function submit () {var mes = $ ("form "). validtor (); if (mes) {$. dialog. openDialogString (mes); return false;} var url = "/OACustomer/SubmitAddLog"; $. ajax ({type: "post", url: url, data: $ ("form "). serialize (), dataType: "json", beforeSend: function () {}, error: function. dialog. openDialogString ("loading failed, please try again") ;}, success: function (data) {if (data. dictJsonStatus = 200) {// fill in the json data returned by the entered log to customer details $. zProtocol ({type: "Close. page ", path:"/1 ", success: 'dunnage ('+ JSON. stringify (data) + ')'});} else {$. dialog. openDialogString (data. msg );}}})}
// Page content <form action = "/OACustomer/SubmitAddLog"> // The action (SubmitAddLog) that submits data in the background <! ------ Action submission address ------> <input type = "hidden" value = "@ detail. id "name =" FkOACustomer "/> <div class =" remarks "> <p> <I style =" color: # f00 "> * </I> remarks: </p> <textarea placeholder = "please fill in the application form (required) "class =" js_inputbox "name =" Remark "data-tipname =" Remarks "data-valid = '{required: true} '> </textarea> </p> </div> </form>
After data is retrieved, click Submit to close A page, that is, page B, and return to the previous page, that is, page. Finally, the data is displayed in the red box on page.