Skip to Content
Menu
This question has been flagged
5 Replies
7283 Views

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

Hello, 
You can check the following link  Click Here

I think it helps you.

Avatar
Discard
Author

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

Hi,

Please try this,

var result = "<t t-esc="test_var"/>";
Thank you
Avatar
Discard
Related Posts Replies Views Activity
3
Aug 17
7867
1
Jan 21
5642
0
Feb 24
311
0
Aug 23
1425
1
Feb 23
1865