0
Is there any way to send a string by parameters in javascript
?
I have something like:
<i class="fa fa-folder-open" aria-hidden="true" style="cursor:pointer;" onclick="en('.$datas['contribuinte'].')"></i>
This button when you click, you have to take the variable to the function, but sometimes the variable inside can contain zeros on the left, so the function recognizes as integer and takes out zeros, so I want to turn it into string.
Function:
function en(x)
{
window.open("en/vers.php?cls="+x,"_blank");
}
Example: If the variable contains "000000001" I didn’t want the function to turn into "1".
In this case you have to deal with it in PHP, that is to say make a string on the PHP side. It is the most correct.
– Sergio