In our webpage, we need to access to a PHP variable inside a javascript code. Specifically, we need to pass a parameter that is a URL defined by a PHP variable called $link_es
I've tried doing this
var r_obj = {
"Company": { "CompanyId": xxxxxx },
"RatingboxId": xxxxx,
"ProductCode": encodeURIComponent($link_es),
where $link_es is the URL stored in a variable that we need to pass as parameter.
How could I pass that parameter? That is, how could I convert a PHP variable into a Javascript one? Thank you.
PD: I'm using Smarty PHP so there could be some problems there.