I have a button
onclick="click(' . $item . ');"
then the javascript function is supposed to pass $item to another page. It works fine if $item is a number, but not if it’s a string, and sometimes it’s a mix of characters and numbers which I can’t control.
function click(c)
{
var u = "items.php?serial=" + c;
document.location.href = u;
}
Is there a way to do this in JS?