接收实体而不是报价

时间:2017-04-29 13:20:32

标签: javascript

我正面临着一个问题,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');
        },
    });
}

1 个答案:

答案 0 :(得分:-1)

回复是正确的。

单引号有unicode#39。见http://www.codetable.net/decimal/39