}).
error(function(data, status, headers, config) {
});
};
$scope.$watch('content', function(newVal, oldVal) {
if (angular.isDefined(newVal)) {
console.log($("<div>").html(newVal).text().replace(/(\r\n|\n|\r)/gm,"").replace(/^\s+/g," ").replace(/\s+$/g," "));
var length=$("<div>").html(newVal).text().replace(/(\r\n|\n|\r)/gm,"").replace(/^\s+/g," ").replace(/\s+$/g," ").length;
if (length>0) {
$scope.disabledSubmit=false;
} else {
$scope.disabledSubmit=true;
}
}
});
$scope.submit=function() {
var url='/Demo/comment',
转载于:https://www.cnblogs.com/huayushuangfei/p/5056877.html
本文探讨了在前端页面中实现评论提交功能的过程,并通过优化HTML、CSS和JavaScript代码提高用户体验。重点介绍了如何通过监听输入内容变化来动态调整提交按钮的状态,确保用户在输入有效内容后才能提交评论。

被折叠的 条评论
为什么被折叠?



