var entityMap = {
"&": "&",
"<": "<",
">": ">",
'"': '"',
"'": ''',
"/": '/'
};
function escapeHtml(string) {
return String(string).replace(/[&<>"'/]/g, function (s) {
return entityMap[s];
});
}
var name = "Joe O'Neal";
var safe_name = escapeHtml(name);
var row= [];
row.push(
"<td><input type='hidden' name='milestones[" + id + "].Name'
value='" + safe_name + "' class='currentRowName' />
<span class='currentRowNameText'>" + safe_name + "</span></td>");