as the title already says I am calling a onclick method in php, but every string with a space in it seems to fail.
php (mysql loop)
echo '<img onclick=test("'.$row['name'].'","name'.$row['id'].'") src="blabla.png"/>';
javascript
function test(vali, id){
alert(vali); //Maria, Josef (but not "Michael Jackson")
alert(id); //name23, name28
}
As I said if its a string without a space, alert method is getting called and shows the text, however with at least one space nothing happens.