By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,848 Members | 3,202 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,848 IT Pros & Developers. It's quick & easy.

Javascript Chat Client

risk32
P: 98
Hello All. As I am pretty sure this question has ALREADY been posted, I have a, well, more restricted concept.

Is it at all possible to create a chat client strictly from html and JS (plus CSS for style formatting and basic setup)? The frames I have created using HTML look rather bland and dont really have the style I want. Which is why JS and CSS come into play...

I do not have any server apllications or software for that matter available to me, frankly because I dont have access rights to the server or to be able to install anything on the workstation I am currently using. This is where the restriction lies... I do have access, however, to everything I need on my homestation but I need to directly upload everything I work on at my workstation. Limited is an understatement at the least.

I haven't started so much, as I'm just looking for suggestions on what kind of style is recommended, and what features are more commonly used for the general public. Any suggestions or links to tutorials on this matter would be GREATLY appreciated. I have been looking at some tutorials and I found something that will work at what I'm trying to do, but it's in PHP and MySQL (two things not allowed on the network) Ugh... I'm stuck with Notepad and Microsoft Office.

Anyways, thanks for taking the time to read this, even if I dont get any replies.
Oct 20 '08 #1
Share this Question
Share on Google+
18 Replies


acoder
Expert Mod 15k+
P: 16,027
I'm afraid JavaScript won't help here. You need server-side code.
Oct 21 '08 #2

iam_clint
Expert 100+
P: 1,208
Since I've never seen javascript listen on ports (act as a server) I'm afraid you cannot do this without a server side language as well as the javascript

client -> server -> client

if javascript could act as a server it would just be

client -> client


client = javascript in this scenario
Oct 21 '08 #3

risk32
P: 98
Do you have a good suggestion on what to use as server-side languages? Possibly AJAX or something like that?
Oct 27 '08 #4

acoder
Expert Mod 15k+
P: 16,027
Ajax is not a server-side language. It's the name given to a group of already existing technologies/languages which provide the ability to call and receive from the server-side without reloading/refreshing/unloading the page.

You mention that PHP is not allowed, so the server-side language you use will depend on what's available for you.
Oct 27 '08 #5

risk32
P: 98
Could JSSP be used?

Might not make too much sense, but is there a way to create a virtual server (like a VPN within a router) on a localhost? More or less, setup up a client as a server without all the programs needing to be loaded.
Oct 28 '08 #6

acoder
Expert Mod 15k+
P: 16,027
I'm not sure what you mean by without all the programs needed to be loaded, but yes you can use localhost as a server, but then you'd need to accept requests from clients otherwise there's not much point in chatting to oneself.

By JSSP, did you mean JSP?
Oct 28 '08 #7

risk32
P: 98
I'm not sure what you mean by without all the programs needed to be loaded, but yes you can use localhost as a server, but then you'd need to accept requests from clients otherwise there's not much point in chatting to oneself.

By JSSP, did you mean JSP?
JSSP = Java Script Server Page (think thats the acronym)
Oct 29 '08 #8

acoder
Expert Mod 15k+
P: 16,027
It would still require a server that can execute Java servlets.
Oct 29 '08 #9

gits
Expert Mod 5K+
P: 5,235
JSSP = Java Script Server Page (think thats the acronym)
I've never heard of that ... i think you indeed mean Java Server Pages = JSP which is completely different from JavaScript. for real JavaScript-serverside code execution you would need special plugins/enhancements of the webserver like mod_js or a JavaScript-enabled Application Server like Jaxer or something like this.

kind regards
Oct 29 '08 #10

acoder
Expert Mod 15k+
P: 16,027
I think risk32 was referring to JSSP - JavaScript Server Pages. It requires a Java server, e.g. Tomcat.
Oct 29 '08 #11

rnd me
Expert 100+
P: 427
if you have an http server (not necessarily a scripting server like asp or php), you can save files using ajax without any server scripts.

using a bouncing script tag, you would simply load the file every couple seconds.

it displays the text, then rewrites the file with new text, or blanks it, whatever.

i have made this before without any server-side scripts.

i would be more than happy to post my app if you can use it.



do you access the page from a file:// , or a http:// URL?
Oct 29 '08 #12

gits
Expert Mod 5K+
P: 5,235
I think risk32 was referring to JSSP - JavaScript Server Pages. It requires a Java server, e.g. Tomcat.
hmmm ... as i said i've never heard of it before ;) ... now i know it. it seems to be just one more serverside JavaScript supporting Webserver-(AppContainer)-module to allow serverside JS-code-execution ... and it's interesting to know that the number of such things still increases ... but i guess that this is not a real advantage over settled techniques ... except for small applications with small amounts of data where no performance-critical tasks are to be expected ... JavaScript has too much drawbacks when it comes to serverside code ... of course it is quite capable for a lot of things but at least when you need high-performance processing, image-processing-capabilities etc. it is not enough and you need another language too ... so this would break the technical layers a bit by mixing up different techniques for one 'logical' layer and in bigger projects this is just a pain to maintain ... at least it could be ;)

just my 2 cents about this topic ;)

kind regards,
gits
Oct 29 '08 #13

risk32
P: 98
if you have an http server (not necessarily a scripting server like asp or php), you can save files using ajax without any server scripts.

using a bouncing script tag, you would simply load the file every couple seconds.

it displays the text, then rewrites the file with new text, or blanks it, whatever.

i have made this before without any server-side scripts.

i would be more than happy to post my app if you can use it.



do you access the page from a file:// , or a http:// URL?
All of our sites (well I should say site) is run from a local server not available through http://, therefor being run from file:// (also makes it a pain to write code because of the darn Shell() command in VB even though I've been able to manage).

The server we have is VERY strict. Welcome to the government...
The only "software", and I use this term VERY VERY loosely, is Notepad and IE. I've been asking for months for new software but it hasn't happened and probably never will. Some days I wish I was still civilian.

As far as having an http server, thats most likely a no. Everything is intranet.
Oct 30 '08 #14

Tarantulus
100+
P: 114
As far as having an http server, thats most likely a no. Everything is intranet.
I hate to say you are out of luck sir, it would be very easy to do what you want if you could write to a file or database, but javascript cannot do these things
Oct 30 '08 #15

gits
Expert Mod 5K+
P: 5,235
hmmm ... with an IE only solution you could do that with some activeX-magic ... you could fill an Access-DB that is on your server and the clients could read from there ... but as i said: this is just an IE-solution - could you live with that?
Oct 30 '08 #16

rnd me
Expert 100+
P: 427
good call gits, an ie only is possible!

you may have to change a setting or two, but you could use my schema (using a commonly accessible text file to store messages) in a file:/// environment with IE.

i can easily alter my aforementioned app to do this if you want.
Oct 30 '08 #17

gits
Expert Mod 5K+
P: 5,235
hi ... i thought about the file solution too ... could it be a problem with concurrent use on the file-sytsem when different clients wants to write/read the file the same time? therefore i suggested a database and an Access-mdb could do the job? ...

kind regards
Oct 30 '08 #18

risk32
P: 98
hi ... i thought about the file solution too ... could it be a problem with concurrent use on the file-sytsem when different clients wants to write/read the file the same time? therefore i suggested a database and an Access-mdb could do the job? ...

kind regards
The database soution is a good idea and I've been trying to work on that.

I have a program set up to open a PowerPoint file dynamically, as in the file name changes with the date. Acoder helped me out a lot with this and for that I must say "Thank You". I did, however, try to adapt the program into VB so that it's easier to code and can be saved as an executable, but that's another part of it. The only problem is the continuity on saving a file in the same format... other users dont know how to do it correctly for the programs I have written. Here's an example:

Program format:
Date + Month + Year + .ppt (01 January 2008.ppt)
User format:
Date + Month + Year + .ppt (this could be anything imaginable... so herein lies the problem - 1 JAN 08, 01 JAN 2008, 1 JAN 2008, 1 JANUARY 2008, you get the idea...)

If I knew how to write the code to only be able to save a file in a strict format, I'd be a happy camper. Without it, I have to manually go in each file (after 365 files +, I'm ready to find a better solution..). With 180 people accessing the same server and myself, a very green progammer/webmaster, this becomes time consuming and detracts from my primary duties. Granted, the file system I'm using isn't what the topic is primarily about, it just goes to show that not everyone can follow a defined format.

With the chat client, I have a pretty good idea of what it should look like and how it should work. The database would definately work for keeping track of usernames and passwords. Could the database also be used for keeping log files? Like if a user has an error or such? I understand that keeping log files of conversations would go against personal privacy, so I try to avoid that.I also am aware that this may be shot down by those in a higher position that myself. More or less, trying to get a product out for testing, THEN maybe try to push it past the subordinate section that I'm at.
Oct 31 '08 #19

Post your reply

Sign in to post your reply or Sign up for a free account.