Frontend page jump and get value, page Jump

Source: Internet
Author: User

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.

 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.