Skip to Content
Meniu
Trebuie să fiți înregistrat pentru a interacționa cu comunitatea.
Această întrebare a fost marcată
3 Răspunsuri
5093 Vizualizări

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

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Cel mai bun răspuns

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

Imagine profil
Abandonează
Cel mai bun răspuns
var ajax = require('web.ajax');
var def = ajax.jsonRpc("/controller/route", 'call', {
... # your controller method parameters
});
return
$.when(def).then(function (vals) {
...
});


Imagine profil
Abandonează
Autor

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

Related Posts Răspunsuri Vizualizări Activitate
1
dec. 24
4150
0
iun. 21
2243
2
mai 24
5025
2
iun. 22
4434
0
iun. 21
2454