I want to make a javascript chatroom for me and my friends but the problem is that I don't want to get into any php. Is there a script or library that would allow for editing of text files?
No.
allynfolksjr wrote:
No.
Javascript is a client-side library and can't communicate with another browser unless you have a server acting as the intermediary. Any distributed application in Javascript must have a server component.
KermMartian wrote:
allynfolksjr wrote:
No.
Javascript is a client-side library and can't communicate with another browser unless you have a server acting as the intermediary. Any distributed application in Javascript must have a server component.

Notice how I was more efficient in my initial answer.
KermMartian wrote:
allynfolksjr wrote:
No.
Javascript is a client-side library and can't communicate with another browser unless you have a server acting as the intermediary. Any distributed application in Javascript must have a server component.


This is only half true.
Quote:
Javascript is a client-side library...

You can write server-side code in Javascript with Node.js thanks to Google's V8 engine. In particular, Socket.io makes it pretty easy to build a javascript chatroom. I've fallen in love with prototyping little Node apps on heroku.

Quote:
...can't communicate with another browser unless you have a server acting as the intermediary.
True, but there are some pretty simple services that will act as an intermediary for you if you plan on using Websockets.
Check out EasyWebSocket(free) or Pusher(paid).
True, but I think his PHP comment was more along the lines of "I don't want to get into any server-side programming" than PHP specifically. Smile Yes, I've wanted to check out Node.js with V8 one of these days, but I unfortunately haven't gotten around to it yet. (Sidebar: Necropost wooo).
Node.js is a great platform. Incredibly fast, too! I built a collaborative text editor using Node.js has the backend and every keystroke was reflected on all the other monitors at the same time, like I was typing on that computer. It was blazing fast!

I've been meaning to build some other cool things with it. In fact, I was using it to build a 2d scroller JavaScript app, but I got a little busy at work Razz
I remember that project. I think it was playable at one point too, right?
Indeed it was. It was a 2d sandboxing game, too, so you could build the world and then play in it. Haven't touched it in a very long time, though. ^^,
For a browser, I don't believe that it is possible (or, for your application, necessary) to use client-side Javascript to edit a text file, which I assume you would use as a log. In order to make a browser-based chat system, you definitely need server logic.

However, I should probably mention that on the upcoming Windows 8, Javascript is a first-class citizen with the OS. That means that Windows applications (at least the full screen ones) can be written in Javascript and HTML 5, and the programs have full access to all of Windows's systems, including the file I/O that you need. So, your chat application (or any other Javascript app that you want to write) can easily be written as a Windows 8 app. Cut the Rope is one example of a Javascript app that was ported to Windows 8, and it supports features, such as in-app purchase, that many web developers never expected to get.
So the answer is Yes and No.

Can you make one without a server-side component? No. Can you make the server-side in JavaScript? Yes.

A chat application has to have a way to relay it to another person. The server is what delegates data to specific connections. In order for a chat application to relay the message to the other user it has to be able to connect to that other user's browser. Browsers can not connect to each other. Browsers connect to servers. So you'll need a server-side to relay your messages to each browser involved in the chat.

If you'd like, I can post some code and walk you through a very simple Node.JS chat, if that's what you end up deciding.
I'd like to introduce you to PubNub (http://pubnub.com). It basically acts as a server intermediary for you, without you having the set up much and work with just the Javascript side of things (as you seem to want to do).
techboy6601 wrote:
I'd like to introduce you to PubNub (http://pubnub.com). It basically acts as a server intermediary for you, without you having the set up much and work with just the Javascript side of things (as you seem to want to do).
Indeed, if you either lack the skills, the inclination, or the time, a solution like that can do the trick. Personally, I'd rather roll my own code even for that sort of thing, as I don't like making my website rely on external services.
Well I eventually did use php for this but that wasn't until a fairly recent project that I titled "Achieve Social". It was a social network for the ouya but the ouya failed and thus so did achieve social Sad It was a fun project to work on though. lots of learning got done.
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement