I have bought Unlimited Elements and need help by building my own template. I have build a function that get parameters from an url. If i alert the output it all works. However when i try to return the values as a variable i cannot access them in the HTML file. Could you please explain me how the return from the JS function can be accessed in the HTML file?
var test = window.location.search const urlParams = new URLSearchParams(test); {{qr_img_url}} = "https://api.qrserver.com/v1/create-qr-code/?data=redirect.rechnung.de/?utm_source=facebook&utm_medium=ads&utm_campaign=campaign1&size=100x100" return {{qr_img_url}}
In preview the following is show: <img width="„150“" height="„150“" src="" class="attachment-large size-large" sizes="(max-width: 150px) 100vw, 150px">
the source is not displayed. Could you please tell me how to get the variable from the JS file to the HTML?
Good afternoon,
I have bought Unlimited Elements and need help by building my own template. I have build a function that get parameters from an url. If i alert the output it all works. However when i try to return the values as a variable i cannot access them in the HTML file. Could you please explain me how the return from the JS function can be accessed in the HTML file?
Best
chris
No I am trying to build my own.
the JS code is this one:
var test = window.location.search
const urlParams = new URLSearchParams(test);
return {{urlParams}}
and the HTML is this one:
<div id={{uc_id}}>
< script src="var" class="redactor-linkify-object">https://www.rechnung.de/wp-content/uploads/ac_assets/js/domain.js">var er = test() </ script>
{{er}}
</div>
I want to get multiple variable from the js in the html
Thanks for your answer. I have set up the variable: {{qr_img_url}}. But it does not show the expected results.
I have tried the following:
Html:
<div id={{uc_id}}>
<img width=„150“ height=„150“ src={{qr_img_url}} class="attachment-large size-large" sizes="(max-width: 150px) 100vw, 150px">
</div>
JS:
var test = window.location.search
const urlParams = new URLSearchParams(test);
{{qr_img_url}} = "https://api.qrserver.com/v1/create-qr-code/?data=redirect.rechnung.de/?utm_source=facebook&utm_medium=ads&utm_campaign=campaign1&size=100x100"
return {{qr_img_url}}
In preview the following is show:
<img width="„150“" height="„150“" src="" class="attachment-large size-large" sizes="(max-width: 150px) 100vw, 150px">
the source is not displayed.
Could you please tell me how to get the variable from the JS file to the HTML?
Best
https://www.sh3a3-clean.com/%d8%b4%d8%b1%d9%83%d8%a9_%d8%aa%d9%86%d8%b8%d9%8a%d9%81_%d8%b3%d8%aa%d8%a7%d8%a6%d8%b1_%d8%a8%d8%a7%d9%84%d8%b1%d9%8a%d8%a7%d8%b6/ " >شركة تنظيف ستائر بالرياض </a>
https://www.sh3a3-clean.com/%d8%b4%d8%b1%d9%83%d8%a9_%d8%aa%d9%86%d8%b8%d9%8a%d9%81_%d9%82%d8%b5%d9%88%d8%b1_%d8%a8%d8%a7%d9%84%d8%b1%d9%8a%d8%a7%d8%b6/ " >شركة تنظيف قصور بالرياض </a>
https://www.sh3a3-clean.com/%d8%b4%d8%b1%d9%83%d8%a9_%d8%aa%d9%86%d8%b8%d9%8a%d9%81_%d9%85%d8%b3%d8%a7%d8%ac%d8%af_%d8%a8%d8%a7%d9%84%d8%b1%d9%8a%d8%a7%d8%b6/ " >شركة تنظيف مساجد بالرياض </a>
https://www.sh3a3-clean.com/%d8%b4%d8%b1%d9%83%d8%a9_%d8%aa%d9%86%d8%b8%d9%8a%d9%81_%d8%a3%d8%ad%d9%88%d8%a7%d8%b4_%d8%a8%d8%a7%d9%84%d8%b1%d9%8a%d8%a7%d8%b6/ " >شركة تنظيف احواش بالرياض </a>