Se rendre au contenu
Menu
Cette question a été signalée
3 Réponses
5178 Vues

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

Avatar
Ignorer
Meilleure réponse

$.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
Ignorer
Meilleure réponse

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
Ignorer
Meilleure réponse
var ajax = require('web.ajax');
var def = ajax.jsonRpc("/controller/route", 'call', {
... # your controller method parameters
});
return
$.when(def).then(function (vals) {
...
});


Avatar
Ignorer
Auteur

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

Publications associées Réponses Vues Activité
1
déc. 24
4220
0
juin 21
2290
2
mai 24
5092
2
juin 22
4521
0
juin 21
2484