Step 1 -
I use a post method to return data values and the data values may return apostrophe character and assign the value to a variable. For example,
var returnData = "Test's failure";
Step 2 -
Next, I attempt to assign the variable to the value of a data type like this:
$("testList").append("<li data-test='"+ returnData +"'>" + test_List + " </li>);
Summary -
When using firebug to view the value for the variable returnData placed in the attribute data-test, it shows the value of Test and 's failure is not added. How can I fix this problem?