unterminated string constant error. when converting an object to json string
<p>My json is like: </p>

<pre><code>"ModelNo":"TEST 5","Weight":5,"ExportLevel":"Req'd","SafetyType":"UNDETERMINED"
var jsonString = JSON.stringify(rowObject);
</code></pre>

<p>I have tried the below code, but it didn't help:</p>

<pre><code>jsonString.replace("'", "\\'");
</code></pre>

<p>I believe this single quote is the issue. Please help. How to escape this?</p>

<p>My Code:</p>

<pre><code>me.getHyperlinkColumn = function (cellvalue, options, rowObject) {       
    //var jsonString = JSON.parse(rowObject);        
    hyperLink = "&lt;a href='#' id='hplinkactionUrl_" + options.rowId + "' onclick='" + options.colModel.CallMethod + "(" + options.rowId + "," + JSON.stringify(options) + "," + JSON.stringify(rowObject) + ")' style='text-decoration:underline; color:#3361b8;'&gt;" + cellvalue + "&lt;/a&gt;"
    return hyperLink;
}
</code></pre>