Přejít na obsah
Menu
You need to be registered to interact with the community.
This question has been flagged
5 Odpovědi
8261 Zobrazení

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
Zrušit
Nejlepší odpověď

Hello, 
You can check the following link  Click Here

I think it helps you.

Avatar
Zrušit
Autor

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

ok, can you share your code?

Nejlepší odpověď

change 

var result = "<t t-esc="test_var"/>";
in 
var result = '<t t-esc="test_var"/>';
Avatar
Zrušit
Nejlepší odpověď

Hi,

Please try this,

var result = "<t t-esc="test_var"/>";
Thank you
Avatar
Zrušit
Related Posts Odpovědi Zobrazení Aktivita
3
srp 17
9116
1
led 21
6742
0
led 25
1055
0
úno 24
1301
0
srp 23
2414