I am trying to pass strings with spaces and special characters, but its getting error and nothing is working. e.g.
<img onclick='addKeyword("celebritynews&gossip");' src="images/plus.png" >
but the '&' inside string celebritynews&gossip is breaking the code.
I figured out that the problem is in addKeyword
function, I'd used the following code for defining a variable named url,
function addKeyword(categoryId){
var url = "addKeyword.php?uid=" + user_id + "&categoryId=" + categoryId + "&keyword=" + $("#keyword_" + categoryId).attr("value");
}
and that $("#keyword_" + categoryId) is causing problem. Any way to solve that?