Skip to Content
Меню
Вам необхідно зареєструватися, щоб взаємодіяти зі спільнотою.
Це запитання позначене
3 Відповіді
5586 Переглядів

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 :)

Related Posts Відповіді Переглядів Дія
1
груд. 24
4648
0
черв. 21
2652
2
трав. 24
5463
2
черв. 22
4892
0
черв. 21
2862