此代码显示不间断的空格转义序列而不是实际空格:
<html>
<head>
<script src="../js/jquery.min.js"></script>
<script src="../js/knockout-2.2.1.js"></script>
<script>
$(document).ready(function() {
var modelType = function() {
this.A = ko.observable('a b c');
};
var model = new modelType();
ko.applyBindings(model);
});
</script>
</head>
<body>
<p data-bind="text: A"></p>
</body>
</html>
它显示以下内容:
a b c
代替
a b c
如何防止这种行为?