简体   繁体   English

我如何使用angular将服务器javascript函数的结果显示到html页面

[英]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.

相关问题 如何在HTML页面中显示JavaScript函数? - How can I display a JavaScript function into the HTML page? 如何使用HtmlUnit从JavaScript html页面获取结果? - How can I get the result from the JavaScript html page using HtmlUnit? 如何使用 HTML/Javascript 从另一个页面显示某些内容? - How can I display something from another page by using HTML/Javascript? 在第二个HTML页面上显示JavaScript函数的结果 - Display the result of JavaScript function on the second HTML page 如何使用 javascript 函数的返回来显示 HTML 按钮? - How can I display an HTML button using the return from a javascript function? 我如何从具有javascript功能的页面获取html? - How can i get html from a page that has javascript function? 如何在HTML中显示JavaScript函数的结果? - How do I display my result of a JavaScript function in HTML? 如何将此 javascript 和 HTML 代码添加到 angular 项目中? 我可以在 ZD18B8624A0F5F721DA7B82365FC56 中从 javascript function 渲染 html - How Do I add this javascript and HTML code into an angular project? and can i render html from javascript function in angular? 如何在离子或角度页面中显示自定义JavaScript小部件 - How can I display custom javascript widgets in ionic or angular page 如何将Javascript函数的值显示在HTML页面上? - How to display value from a Javascript function onto an HTML page?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM