我正面临着一个问题,Javascript不允许我通过ajax返回数据,并在单词结尾处单引号?
例如,我试过返回
You don't have enough credit to perform this
我收到了
You don't have enough credit to perform this
为什么?
代码:
function sellStock(businessId, stockId, stockName) {
var mymodal = $('#sellStockModal');
$.ajax({
url: ajaxCallUrl + 'api/ajax/stock/' + businessId + '/' + stockId + '/get-modal-content',
type: "GET",
error: function(req, message) {
showErrorNotification('It seems something went wrong, sorry...' + message);
},
statusCode: {
400: function (response) {
showErrorNotification(response.responseText);
},
500: function (response) {
showErrorNotification(response.responseText);
}
},
success: function(data) {
mymodal.find('.modal-body').html(data);
mymodal.modal('show');
},
});
}