I am trying to pass a variable frm php to a javascript function, however a space keeps getting appeneded, and I can not see how.
The relevant php code snippet:
<p><a href='#' onclick=\"makewindows(" . $html . "); return false;\">Click for full description </a></p>".$brand."
<p><a href=\"#\" onclick=\"deleteRec('".$ARTICLE_NO."', '".$brand."', '".$pg."', '".$nextArticleNo."')\">DELETE</a>
$brand is what I want to pass, and deleteRec is the name of the function.
At the end of the first line I am echoing out brand before the link to deleteRec, and it contains no space. In my test case, it is set to simply 'o'.
The link that is genereated for deleteRec however, clearly contains a space, and I don't know where it is coming from.
<a href="#" onclick="deleteRec('190274380300', ' o', '2', '250343889611')">DELETE</a>