2
I wanted to know how to concatenate a link inside an attribute href
with a variable?
Observation has to be something 'inline'.
I use a platform that doesn’t let me use scripts inside the page so the reason of inline.
Example:
var teste = [x];
<a href="#" onclick="window.open('http://websro.correios.com.br/sro_bin/txect01$.QueryList?P_LINGUA=001&P_COD_UNI=',teste)" target"_blank">vai</a>
The way out should be:
http://websro.correios.com.br/sro_bin/txect01$.QueryList?P_LINGUA=001&P_COD_UNI=[x]
My code is wrong in the organization of elements or quotes in the wrong place so disregard that part. I need a hint of how I would put this together.
Can place an example in Jsfiddle?
– dann
Yes, I edited the answer with the link
– bfavaretto
Your answer was the one that got closer, so I’ll take it for granted. Thanks @bfavaretto
– dann