Forum Moderators: open

Message Too Old, No Replies

Is Javascript Ever Server-Side?

         

Storyman

3:52 pm on Sep 4, 2004 (gmt 0)

10+ Year Member



While working through some sample templates one of them used javascript with PHP. What intriqued me was that the javascript appeared to be processed on the server-side.

All the javascipt was used for was to replace variables in one file that were assigned in another.

As a test the javascript was turned off in the browser (FireFox .0.9.3) and it worked fine.

It never occurred to me that javascript could be processed on the server-side.

Just a 'duh' moment, I guess.

jatar_k

3:55 pm on Sep 4, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



>> Is Javascript Ever Server-Side?

no, so it would be the php doing the server side work.

Rambo Tribble

12:44 am on Sep 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, there is server-side JavaScript. Most commonly it is encountered used with servers running ASP, though VBScript is more common. [w3schools.com...]

Bernard Marx

9:38 am on Sep 5, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



..although you'll usually find it referred to as JScript.

Javascript and PHP? What's going on there?

silk

7:35 am on Sep 13, 2004 (gmt 0)

10+ Year Member



Javascript can be used to write HTML.
PHP scripts can be embedded in HTML, thus u can use javascript to "write" a php script.

I used to wonder if there was ever "server-side" javascript myself. Now what i want to know is:

Does the server intepret the javascript or the client?
i'm not to clear on this.

Staffa

8:19 am on Sep 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



In "Guide to Building Intelligent Websites with Javescript" by Nigel Ford there is a whole chapter dedicated to Server-Side Javascript.
Since I'm not interested I have not read the whole chapter but it says :

'server-side JavaScript requires a server running Netscape's server software........
it offers facilities not available to client-side JavaScript......
it enables read and write access to files and databases stored on the server' etc.

Bernard Marx

11:06 am on Sep 13, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



'server-side JavaScript requires a server running Netscape's server software........

That's certainly not true anymore. ASP classic is scripted in VBScript by default, but can be scripted with JScript (aka Javascript) if the language is specified in the script (kind of a reverse of the client-side situation in IE).

My guess is that pretty much any application that can have a Javascript engine bolted onto it can be scripted with Javascript.