5 install
{ "addon_id": data.id }{ "addon_title": data.title }
5
5 install
{ "addon_id": data.id }{ "addon_title": data.title }
5
if all other steps are the same
//
function x_request(params){
$.post('url',params,function....)
}
//
X_request({ 'addon_id': data.id })
X_request({ 'addon_title': data.title })
function postSomething(payload) {
...
$.post('{...}', payload, function(data) {
...
}
postSomething({ 'addon_id': data.id })
postSomething({ 'addon_title': data.title })
first propose a network tool that calls this method whenever it is a network request. At the same time, it can also encapsulate get
, push
and other methods
function post(url, data, success, failure)
package another model
function installModel(data, success, failure){
post('.../install',data, success, failure)
}
Last view layer call
table.on("...", function(){
installModal(data, function success(){...}, function failure(){...})
})
//
function x_request(event, params) {
switch (event) {
case 'install':
$.post('url', params, xxxx);
break;
case 'xxx':
$.post('url', params, xxxx);
break;
}
}
//
X_request(obj.event,{ 'addon_id': data.id })
X_request(obj.event,{ 'addon_title': data.title })
Previous: Error in thymeleaf referencing webjar.
A project you are working on requires rich text functionality, which is transcoded using the encodeURIComponent method when you submit, but will the browser automatically decode it when you send a request? meeting description has been converte...