Skip to Content
Menu
You need to be registered to interact with the community.
This question has been flagged
5 Odgovori
8257 Prikazi

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
Opusti
Best Answer

Hello, 
You can check the following link  Click Here

I think it helps you.

Avatar
Opusti
Avtor

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

ok, can you share your code?

Best Answer

change 

var result = "<t t-esc="test_var"/>";
in 
var result = '<t t-esc="test_var"/>';
Avatar
Opusti
Best Answer

Hi,

Please try this,

var result = "<t t-esc="test_var"/>";
Thank you
Avatar
Opusti
Related Posts Odgovori Prikazi Aktivnost
3
avg. 17
9114
1
jan. 21
6736
0
jan. 25
1054
0
feb. 24
1301
0
avg. 23
2414