콘텐츠로 건너뛰기
메뉴
커뮤니티에 참여하려면 회원 가입을 하시기 바랍니다.
신고된 질문입니다
3 답글
5173 화면

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

관련 게시물 답글 화면 활동
1
12월 24
4219
0
6월 21
2287
2
5월 24
5087
2
6월 22
4511
0
6월 21
2480