|
-
Aug 5th, 2002, 03:55 PM
#1
Thread Starter
Fanatic Member
read files with javascript
How do u use javascript to write to an on server file. How do u open it back up to read it.
-
Aug 5th, 2002, 06:04 PM
#2
Fanatic Member
javascript only works on the client side it cannot do server side work. You will need to use PHP, Perl, ColdFusion, ASP, or Java
-
Aug 6th, 2002, 05:57 AM
#3
Frenzied Member
I think you can use JavaScript server-side, that's what I read on a JavaScript tutorial on the Netscape developer site anyway.
-
Aug 6th, 2002, 06:50 AM
#4
Fanatic Member
you can use javascript inside a server side script but javascript cannot interact with the server. (that would provide tens of thousands of ways a hacker could maliciously access your server)
Last edited by cpradio; Aug 7th, 2002 at 02:46 PM.
-
Aug 6th, 2002, 07:54 AM
#5
Frenzied Member
Oh right. I seem to remeber the site saying that the only things it adds are the ability to read and write files when used server-side.
-
Aug 6th, 2002, 09:21 AM
#6
Fanatic Member
Server-side javascript is known as Livewire. If you have a netscape 2+ server with the Livewire extensions installed you can create a development environment like CGI, PHP etc.
http://oradb1.jinr.ru/netscape/wssja/jsserv.htm
-
Aug 6th, 2002, 01:24 PM
#7
Frenzied Member
Wow I never knew that, although that's not really saying much
-
Aug 7th, 2002, 11:54 AM
#8
Black Cat
Javascript is not really client-side or server-side. All you need is some kind of host that provides objects for an embedded javascript interpreter to access. A web browser is the most common javascript host around because that's what it was created for, but, AFAIK, there's nothing in the Javascript / ECMAScript specs that specifically define it as client or server side, so you could add it to a web server, or you could put a javascript interpreter inside a Office Suite to allow Macro functionality. Conversely, if you put a PHP or Perl interpreter inside a browser, you have client-side PHP or Perl. (Perl can run inside IE with ActiveState's distro, but I don't know if this has been done with PHP yet)
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Aug 7th, 2002, 12:42 PM
#9
Thread Starter
Fanatic Member
Basically im trying to create a chat room, and i figured the easiest way to do it is by having a text box and a button, when they click the button it writes to a file and every second it reloads the file. This way everyone can see the file. Is that server side or client-side
-
Aug 7th, 2002, 02:18 PM
#10
Black Cat
The form submission handling and writing of the file would be server-side.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Aug 8th, 2002, 03:16 AM
#11
Fanatic Member
Javascript is not really client-side or server-side...
Thats a good point Josh. To be honest, I don't see why, in todays world, you would need to use server-side javascript when there are so many server-side technologies and languages around. I think php would be the way to go as it shares syntax with c, similar to javascript.
Do you happen to know of any hosts that support server-side javascript?
-
Aug 8th, 2002, 10:42 AM
#12
Black Cat
Well, using JScript with ASP is pretty much the same as using server-side javascript. I'm fairly certain MS uses the same Jscript engine for JScript as it does javascript inside IE (or anywhere else). You probably could also set IIS (and probably Apache on Windows) to run *.js files as CGI thru WSH.
If you already know javascript syntax (from using it on your web pages), and you don't know PHP, why not use server-side javascript if its available? Then again, javascript has only a handful of built-in objects, so it would have to rely on the host/server to supply it with a good library to use. There's no native network or database connectivity or file i/o objects built into javascript natively (for good reason), which is why you don't see server-side javascript used too often.
And who says PHP is a server-side technology? AFAIK, they're working on TK (or whatever) libraries so you can write stand-alone GUI apps not in need of a client or a server.
Josh
Get these: Mozilla Opera OpenBSD
I have books for sale: "MCSD in a Nutshell" and "VB Distributed Exam Cram" - PM me for details. Will also trade for a decent ATX Pentium 2 MB/CPU/RAM combo.
-
Aug 13th, 2002, 03:38 AM
#13
Fanatic Member
And who says PHP is a server-side technology? AFAIK, they're working on TK (or whatever) libraries so you can write stand-alone GUI apps not in need of a client or a server.
Another good point, I'll have to have a look into that. Thanks for the information.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|