Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
5 Odpowiedzi
8289 Widoki

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.

Awatar
Odrzuć
Najlepsza odpowiedź

Hello, 
You can check the following link  Click Here

I think it helps you.

Awatar
Odrzuć
Autor

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

ok, can you share your code?

Najlepsza odpowiedź

change 

var result = "<t t-esc="test_var"/>";
in 
var result = '<t t-esc="test_var"/>';
Awatar
Odrzuć
Najlepsza odpowiedź

Hi,

Please try this,

var result = "<t t-esc="test_var"/>";
Thank you
Awatar
Odrzuć
Powiązane posty Odpowiedzi Widoki Czynność
3
sie 17
9138
1
sty 21
6780
0
sty 25
1068
0
lut 24
1319
0
sie 23
2428