跳至內容
選單
此問題已被標幟
5 回覆
8287 瀏覽次數

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
9136
1
1月 21
6778
0
1月 25
1064
0
2月 24
1314
0
8月 23
2426