Javascript AJAX发送方法和按钮可见性
所以,在面板上有一个文本区域,在输入第一个字符后显示的发送按钮下,isButtonVisible()方法控制该区域。它通过AJAX send()方法将文本从textarea发送到data.php,其中来自textarea的数据必须保存在.txt文档中。js文件名是ng-controllers.js有人能帮我吗?我没有angular.js方面的经验 下面是我的HTML文件的外观:Javascript AJAX发送方法和按钮可见性,javascript,jquery,html,ajax,angularjs,Javascript,Jquery,Html,Ajax,Angularjs,所以,在面板上有一个文本区域,在输入第一个字符后显示的发送按钮下,isButtonVisible()方法控制该区域。它通过AJAX send()方法将文本从textarea发送到data.php,其中来自textarea的数据必须保存在.txt文档中。js文件名是ng-controllers.js有人能帮我吗?我没有angular.js方面的经验 下面是我的HTML文件的外观: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="pl" lang="pl" ng-app="Textarea"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8"><style type="text/css">@charset "UTF-8";[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide{display:none !important;}ng\:form{display:block;}.ng-animate-block-transitions{transition:0s all!important;-webkit-transition:0s all!important;}.ng-hide-add-active,.ng-hide-remove{display:block!important;}</style>
<title>Angular - Textarea</title>
<link rel="stylesheet" type="text/css" href="./Angular - Textarea_files/style.css">
<script type="text/javascript" src="./Angular - Textarea_files/jquery.min.js"></script><style type="text/css"></style>
<script type="text/javascript" src="./Angular - Textarea_files/angular.min.js"></script>
<script type="text/javascript" src="./Angular - Textarea_files/ng-controllers.js"></script>
</head>
<body style="padding:0px; margin:0px;" onload="">
<div class="Cont" ng-controller="TextAreaCtrl as ctrl">
<div class="TextAreaCont">
<textarea ng-model="text" placeholder="Write something..." style="margin: 0px; height: 106px; width: 795px;"></textarea>
</div>
<div class="ButtonCont" ng-show="ctrl.isButtonVisible()">
<button ng-click="ctrl.send()">Send</button>
</div>
</div>
</body></html>
@字符集“UTF-8”;[ng \:斗篷],[ng斗篷],[data ng斗篷],.ng斗篷,.x-ng斗篷,.ng隐藏{display:none!重要;}ng \:表单{display:block;}.ng动画块变换{transition:0s all!重要;-webkit变换:0s all!重要;}.ng隐藏添加活动,.ng隐藏移除{display:block!重要;}
角面积
发送
angualr中的Ajax调用使用$http
提供程序
这与jquery中的$.ajax非常接近,即
var httpPost = $http({
method: "post",
url: "example.com/posts",
data: {
// some data here
}
});
然后分配一个函数以在成功时运行
httpPost.success(
function( html ) {
// do something here
}
);
我不知道如何使用angularSo编写ajax文章,你希望有人用Angulars编写服务器端的文件,将其保存在一个.txt文件中吗?不,只是Angulars中的ajax文章,也许应该如何查看data.php来接收它和这个按钮可见的东西。我需要帮助,因为我不知道怎么做。我真的很绝望,谢谢。也许你会知道一些关于按钮可见的事情?