Consider this line of JavaScript
str += "onclick=runTest(" + field + "," + atom[0] + ",'" + atom[1] + "');
In the browser, it renders as:
onclick="runTest(104,213,'Orsan" Miller');
There is an inverted comma between Orsan and Miller although in fact there was not any inverted comma, it's causing a bug.
atom[1] = Orsan Miller
'Orsan Miller' comes from DB query in PHP.
How can this be fixed?