[英]how can i display a result from a server javascript function to a html page using angular
This is a form that will go to the javascript page and will upload the photo to the server 该表格将转到javascript页面,并将照片上传到服务器
<div class="col-sm-5" style="border-right: 1px solid #ccc">
<div class="subStyle" ng-show="showDiv1">
<form id = "uploadForm"
enctype = "multipart/form-data"
action = "/api/photo"
method = "post">
<input type="file" name="userPhoto" />
<input type="submit" value="Upload Image" name="submit">
</form>
</div>
</div>
This is the JavaScript
function 这是JavaScript
函数
function confirmUploaded() {
res.end("File was successfully uploaded -- " + outText);
}
How would i call this function from the JavaScript
file to the HTML page 我如何从JavaScript
文件到HTML页面调用此函数
res.end is not a client side, It is a server side code and need to be send from the server end(NodeJS). res.end不是客户端,它是服务器端代码,需要从服务器端(NodeJS)发送。
Make use of $http.success in angular and then on success attach the result to a particular div or header tags and use css for formatting. 利用$ http.success的angular字体,然后将结果成功附加到特定的div或header标签,并使用css进行格式化。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.