Pular para o conteúdo
Menu
Esta pergunta foi sinalizada
5 Respostas
8280 Visualizações

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
Cancelar
Melhor resposta

Hello, 
You can check the following link  Click Here

I think it helps you.

Avatar
Cancelar
Autor

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

ok, can you share your code?

Melhor resposta

change 

var result = "<t t-esc="test_var"/>";
in 
var result = '<t t-esc="test_var"/>';
Avatar
Cancelar
Melhor resposta

Hi,

Please try this,

var result = "<t t-esc="test_var"/>";
Thank you
Avatar
Cancelar
Publicações relacionadas Respostas Visualizações Atividade
3
ago. 17
9126
1
jan. 21
6769
0
jan. 25
1060
0
fev. 24
1308
0
ago. 23
2417