【发布时间】:2015-01-20 23:46:22
【问题描述】:
所以,有一个文本区域,在面板上的那个发送按钮下,在输入第一个字符后显示,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" "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>
【问题讨论】:
-
我不知道如何用角度制作它
-
所以您希望有人用 Angular 编写 ajax 帖子,然后为您编写将其保存在 .txt 文件中的服务器端位?
-
没有。只是 ajax 以角度发布,也许应该如何看待 data.php 来接收它和这个按钮可见的东西。我需要帮助,因为我不知道该怎么做。我真的很绝望。
标签: javascript jquery html ajax angularjs