jquery Load method echo data

Source: Internet
Author: User

use the jquery object. The load () method is useful for loading data from the server through an AJAX request and placing the returned data directly into the specified element. This method is very simple to use and greatly simplifies the Ajax development syntax: jquery objects. Load (URL, param, callback), URL Access server address param send to server parameter callback execute callback function after normal return note: If Param is present, request as post, if Param does not exist, request it in get mode Example1, basic use<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >function Test () {//sends an AJAX request and assigns the returned response result directly to the Div$ ("#mydiv"). Load ("Servlet/test1", {"str": "You're Fine", "str2": "You're Bad"}); }</script>2, callback use<! DOCTYPE HTML PUBLIC "-//w3c//dtd HTML 4.01 transitional//en" >function Test () {//sends an AJAX request and assigns the returned response result directly to the Div$ ("#mydiv"). Load ("Servlet/test1", {"str": "You're Fine", "str2": "You're Bad"},function (data) {//What's inside the callback functionalert (data);    }); }</script>Note: The callback function executes after the load has populated the data

Project code Example:

function Loadlastinfo (detail) {    $ (//  Call the Load method to load the selected data into the form, very convenient         CustomerCommisonType:detail.customerCommisonType,        CustomerCommison:detail.customerCommison,        otherpay: Detail.otherpay,        otherPay01:detail.otherPay01,        otherPay02:detail.otherPay02,        otherPay03: Detail.otherpay03,        otherPay04:detail.otherPay04,        otherPay05:detail.otherPay05,        otherPay06: DETAIL.OTHERPAY06,        otherPay07:detail.otherPay07,        otherPay08:detail.otherPay08,        otherPay09: Detail.otherpay09,        otherPay10:detail.otherPay10,        otherPay11:detail.otherPay11,        otherPay12: Detail.otherpay12,        IsAudit:detail.audit,        isPriority:detail.isPriority,        remarks:detail.remarks    });}

JQuery Load method echo data

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.