小编Nor*_*Ben的帖子

Rails 3.1 - JS - *.js.erb 中的 Socket.io-emit 未执行并阻止执行 jQuery-Function

我想在我的 Rails-Project 中使用 node.js 来提供异步 io。我不想使用 juggernaut、faye 或类似的东西,因为我需要与 web-socket、服务器发送的事件和 spdy 的干净连接,而没有其他选择。我第一次尝试使用 node.js 现在是使用 Socket.io,只是为了使用 JavaScript 将数据提供给 node.js 模块。但它根本不起作用。

我的 application.js 看起来像这样:

// This is a manifest file that'll be compiled into including all the files listed below.
// Add new JavaScript/Coffee code in separate files in this directory and they'll automatically
// be included in the compiled file accessible from http://example.com/assets/application.js
// It's not advisable to add code directly here, but if you do, it'll appear at the bottom of …
Run Code Online (Sandbox Code Playgroud)

javascript ruby-on-rails ruby-on-rails-3 socket.io ruby-on-rails-3.1

5
推荐指数
1
解决办法
703
查看次数