İçereği Atla
Menü
Bu soru işaretlendi
5 Cevaplar
8307 Görünümler

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.

Avatar
Vazgeç
En İyi Yanıt

Hello, 
You can check the following link  Click Here

I think it helps you.

Avatar
Vazgeç
Üretici

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

ok, can you share your code?

En İyi Yanıt

change 

var result = "<t t-esc="test_var"/>";
in 
var result = '<t t-esc="test_var"/>';
Avatar
Vazgeç
En İyi Yanıt

Hi,

Please try this,

var result = "<t t-esc="test_var"/>";
Thank you
Avatar
Vazgeç
İlgili Gönderiler Cevaplar Görünümler Aktivite
3
Ağu 17
9170
1
Oca 21
6810
0
Oca 25
1087
0
Şub 24
1350
0
Ağu 23
2486