Server/CLient-side Java Script

What is the difference between Server and Client side Java Script.

Comments

  • A server side script is a script that is executed by a server. Client side script is executed by the users computer.

    Server side script:
    PHP / ASP / Perl
    [code]
    1: User does HTTP request for a page
    2: The server runs the script in the page and generates HTML output
    3: The generated HTML output is send to the users computer
    4: The browser displays the downloaded HTML file
    [/code]
    Advantage: Users cannot see the scriptcode itself, only the HTML code that was generated by it. You can also work with files that are stored on the server(hitcounters/guestbooks etc.), you could never do that with 100% client side script.

    Disadvantage: The script is ran by your server wich has to do all the work by itself.


    Client side script:
    Javascript / VBScript
    [code]
    1: User does HTTP request for a page
    2: The server sends the requested page
    3: The script inside the page is executed and HTML output is generated.
    4: The browser displays the generated HTML output
    [/code]
    Advantage: Scripts are executed by the user's PCs and not by the server wich has now more free processortime and memory to do other things like handling more HTTP requests.

    Disadvantage: Everyone can see your code by selecting the view source option within Explorer or by opening the downloaded file in a texteditor.

    : What is the difference between Server and Client side Java Script.
    :
    :

    ;-)
    -mac-
    mailto:programmersheaven@mac-doggie.nl
    the Netherlands...


Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion