跳至内容
菜单
此问题已终结
3 回复
5175 查看

it's any way to call http controller from js and also pass arguments?

形象
丢弃
最佳答案

$.ajax({
url: "/your/controller",
data: data,
type: 'POST',
processData: false,
contentType: false,
success: function(result) {

//success code

}

});


Using type: 'POST' you can call http controller.

形象
丢弃
最佳答案

Hi,

Please Refer the following blog to understand how to call http controller from js

https://www.cybrosys.com/blog/how-to-call-controller-method-from-javascript

Regards

形象
丢弃
最佳答案
var ajax = require('web.ajax');
var def = ajax.jsonRpc("/controller/route", 'call', {
... # your controller method parameters
});
return
$.when(def).then(function (vals) {
...
});


形象
丢弃
编写者

No this only call json controller not http controller. Already tired not working and thanks for reply :)

相关帖文 回复 查看 活动
1
12月 24
4219
0
6月 21
2290
2
5月 24
5092
2
6月 22
4521
0
6月 21
2484