[英]Push notifications to browser window
I am hosting my own server on my private Windows 8 machine. 我将自己的服务器托管在专用Windows 8计算机上。
I am looking to develop an online chat application as a part of a larger website i am developing. 我希望开发一个在线聊天应用程序,作为我正在开发的更大网站的一部分。 A simple Google search suggested using AJAX requests and a server-side chat HTML page, with the browser sending requests to fetch the page every so often via a Javascript loop.
建议使用AJAX请求和服务器端聊天HTML页面进行简单的Google搜索,然后浏览器会通过Javascript循环发送请求以获取页面。 I didn't really like this approach, and was looking for something a little more "modern".
我真的不喜欢这种方法,并且正在寻找一些“现代”的东西。 Normal chat programs use push notifications, so i figured i should be able, too.
普通的聊天程序使用推送通知,所以我认为我也应该能够。 Maybe something like this would work:
也许这样的事情会工作:
I have only had experience with static pages (HTML/CSS/JS) in the past, and have just recently dabbled in PHP. 我过去只接触过静态页面(HTML / CSS / JS),最近才涉猎PHP。 So ... i naturally have some questions.
所以...我自然有一些问题。
I tried using NodeJS, but i have no idea if that would be suitable for my needs, or if there are better alternatives. 我尝试使用NodeJS,但我不知道这是否适合我的需求,或者是否有更好的选择。 To be honest i don't really even know what it is...
老实说,我什至不知道那是什么...
I would say stick with Node combined with socket.io. 我会说坚持使用Node与socket.io相结合。 You can create a push notification application pretty quickly with these.
您可以使用这些快速创建推送通知应用程序。
Check out the socket.io site: http://socket.io 查看socket.io网站: http ://socket.io
Also, I really should have mentioned Sails. 另外,我真的应该提到Sails。 It's an MVC framework for Node that has socketio built right in.
这是Node的MVC框架,内置了socketio。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.