İçereği Atla
Menü
Bu soru işaretlendi
3 Cevaplar
4938 Görünümler

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

Avatar
Vazgeç
En İyi Yanıt

$.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.

Avatar
Vazgeç
En İyi Yanıt

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

Avatar
Vazgeç
En İyi Yanıt
var ajax = require('web.ajax');
var def = ajax.jsonRpc("/controller/route", 'call', {
... # your controller method parameters
});
return
$.when(def).then(function (vals) {
...
});


Avatar
Vazgeç
Üretici

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

İlgili Gönderiler Cevaplar Görünümler Aktivite
1
Ara 24
4060
0
Haz 21
2174
2
May 24
4951
2
Haz 22
4346
0
Haz 21
2372