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

i want to use qweb variables in script.



    <t t-set="test_var" t-value="TEST_VAR_VALUE"/>              

    <script type="text/javascript">

    var result = <t t-esc="test_var"/>;
document.getElementById("div_id").innerHTML = result;
</script>


i tried above code but it doesn't work.

아바타
취소
베스트 답변

Hello, 
You can check the following link  Click Here

I think it helps you.

아바타
취소
작성자

As you see in question, i did exactly same thing but didn't work.

ok, can you share your code?

베스트 답변

change 

var result = "<t t-esc="test_var"/>";
in 
var result = '<t t-esc="test_var"/>';
아바타
취소
베스트 답변

Hi,

Please try this,

var result = "<t t-esc="test_var"/>";
Thank you
아바타
취소
관련 게시물 답글 화면 활동
3
8월 17
9126
1
1월 21
6775
0
1월 25
1062
0
2월 24
1309
0
8월 23
2417