HighDots Forums  

JavaScript vs. Server Side Scripting

JavaScript discussion (multi-lingual) JavaScript discussion (alt.comp.lang.javascript)


Discuss JavaScript vs. Server Side Scripting in the JavaScript discussion (multi-lingual) forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Don G
 
Posts: n/a

Default JavaScript vs. Server Side Scripting - 02-21-2005 , 09:46 AM






I am in the process of teaching myself PHP because I now realize the
potential problems I have on my website because of how I am using
JavaScript (photo galleries, and easing expansion by using variables).

My question is, when does one use JavaScript instead of server side
scripting? I am aware of it's usefulness in form validation, but are
there any other instances?

Is it possible to use JavaScript in conjunction with server side
scripting to improve speed? For example, could I use PHP for the photo
galleries unless the browser has JavaScript enabled? I don't know if
this would improve speed, nor do I know if this is even possible.

Thank you,

Don

Reply With Quote
  #2  
Old   
Enkidu
 
Posts: n/a

Default Re: JavaScript vs. Server Side Scripting - 02-22-2005 , 09:39 PM






Don G <mail4dag (AT) yahoo (DOT) com> wrote on Monday 21 February 2005 06:46:

Quote:
I am in the process of teaching myself PHP because I now realize the
potential problems I have on my website because of how I am using
JavaScript (photo galleries, and easing expansion by using variables).

My question is, when does one use JavaScript instead of server side
scripting? I am aware of it's usefulness in form validation, but are
there any other instances?

Is it possible to use JavaScript in conjunction with server side
scripting to improve speed? For example, could I use PHP for the photo
galleries unless the browser has JavaScript enabled? I don't know if
this would improve speed, nor do I know if this is even possible.

Thank you,

Don
The thing to remember is that the only way Javascript can pass information
between sessions is through cookies. Javascript is designed specificly to
manipulate the DOM, anything further is beyond its scope. You could use PHP
to generate external .js sources for pages and in that way have them
function together, but Javascript could not pass info reliably the other
way. One application for this is for PHP generated pages that have
session-specific dynamic content. You don't want to keep passing the page
back and forth to renew content, so you can have the PHP generate the
script and appropriate CSS as well. There is also Server-Side Javascript,
or SSJS, which is essentially Javascript for server-side functionality. It
works in conjunction with Javascript, but I believe the engine is
proprietary if it's even still alive. Aside from its existence, I don't
know a great deal about it. I hope this helps,

Enkidu
--
--
There is in certain living souls
A quality of loneliness unspeakable,
So great it must be shared
As company is shared by lesser beings.
Such a loneliness is mine; so know by this
That in immensity
There is one lonelier than you.


Reply With Quote
  #3  
Old   
J. Frank Parnell
 
Posts: n/a

Default Re: JavaScript vs. Server Side Scripting - 03-03-2005 , 09:35 PM




"Enkidu" <enkidu (AT) bastardsonofdog (DOT) com> wrote

Quote:
Don G <mail4dag (AT) yahoo (DOT) com> wrote on Monday 21 February 2005 06:46:

I am in the process of teaching myself PHP because I now realize the
potential problems I have on my website because of how I am using
JavaScript (photo galleries, and easing expansion by using variables).
PHP is way better for photo gallerys be cause you can generate them
dynamically, based on whatever is in you r images folder. Want to add to
your gallery? just upload more pics, and the code will see them and add
them to the page.

A great way to learn (and this is one of the major contributors my php
education) would be to mess around this:
http://coding.1-fix.com/php-scripts.htm . the template that comes with it
is a whole web page, but you could just use the main table, and include that
into pages you allready have. Great script to learn about working with
files and directories, generating html tables, links, etc, how functions
work, etc.

Quote:
My question is, when does one use JavaScript instead of server side
scripting? I am aware of it's usefulness in form validation, but are
there any other instances?
js runs when it gets to the users computer, php runs at the server.
Quote:
Is it possible to use JavaScript in conjunction with server side
scripting to improve speed? For example, could I use PHP for the photo
galleries unless the browser has JavaScript enabled? I don't know if
this would improve speed, nor do I know if this is even possible.
Much faster to run code at the server, and have it passed down as html, then
have the user have to download the code, then run it.
J.




Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.4
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.