【问题标题】:Getting data from node.js into HTML page从 node.js 获取数据到 HTML 页面
【发布时间】:2012-12-05 10:33:11
【问题描述】:

我是 node.js 的新手。说 node.js 正在运行

localhost:9090//nodejs/server/messages/1

在那个 url.Application 中运行

本地主机:8080/

我要访问节点,js结果是一个HTML页面。

function get_message() {
  $.getJSON('/nodejs/server/messages/1', function (result) {
    var df = result;
    document.getElementById('txtCompanyId').value = result[0]['CompanyID'];
    document.getElementById('txtCompanyName').value = result[2]['CompanyName'];
  });
}

我使用的这个函数会导致跨域异常。我使用 Apache 中的代理设置解决了它。如何在 IIS 中配置此设置?或者如何在 IIS 服务器上运行时在 Javascript 中调用该 node.js url?

那么如何在 IIS 中托管 node.js?

请帮忙。

【问题讨论】:

    标签: javascript jquery node.js iis


    【解决方案1】:

    我认为您可以使用来自 https://github.com/Flotype/nowhttp://nowjs.comhttp://socket.io 的 NowJS 库。您可以尝试的另一件事是消息传递概念。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2015-07-20
      • 1970-01-01
      • 2013-08-05
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多