コンテンツへスキップ
メニュー
この質問にフラグが付けられました
3 返信
5204 ビュー

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
4235
0
6月 21
2307
2
5月 24
5099
2
6月 22
4543
0
6月 21
2500