Notes on using Ajax in OFBiz

Source: Internet
Author: User

1.To use JSON Type, which can be found in Controller. xml Use Type = "jsonjava"Type = "NONE" The returned data is stored in Request Medium

 

$ JQ. Ajax ({

Type: "Post ",

URL: "<@ ofbizurl>" + u + "</@ ofbizurl>? Productid = "+ ID +" & status = "+ status,

Datatype: "JSON ",

Success: function (data ){

Using jq('{p_'{id}.html ("(" + data. Status + ")");

}

});

 

2.No JSON Type, AJ Ax You can call another FTL Of Screen, The effect is equivalent to local Submit

 

3.$. PostOf BugIn Jquery .

 

Post: function (URL, Data, callback, type ){

If (jquery. isfunction (data )){

Callback = data;

Data = {};

}

 

Return jquery. Ajax ({

Type: "Post ",

URL: URL,

Data: data,

Success: callback,

Datatype: Type

});

}

 

we can see that, If data do not write If , return , data it is null .

all in use post , it is best to add the second parameter with null, {}

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.