Перейти к содержимому
Меню
Чтобы взаимодействовать с сообществом, необходимо зарегистрироваться.
Этот вопрос был отмечен
3 Ответы
4644 Представления

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
3861
0
июн. 21
1988
2
мая 24
4802
2
июн. 22
4074
0
июн. 21
2181