472,789 Members | 882 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,789 software developers and data experts.

Javascript V ASP

dear all,

does a client side script always need a server side script in order to
function?

how can i get my javascript application to send the details of a user
filled form to me without having to have a server side script?

if i have both server side and client side script in a web
application, will the resulting application run as a client or server?

i know i probably haven't made much sense, but the problem is that i'm
trying to make sense of it all.
thanks guys xxx
Jul 23 '05 #1
3 1294
li*******@yahoo.co.uk (Liza) writes:
does a client side script always need a server side script in order to
function?
No.
Client side scripts and server side scripts are completely unrelated.

When a browser requests a page that contains server side scripts,
the scripts are run, like a program, on the server. The result
of running this on the server is an HTML page, that is: text.
When the browser receives the page, the server side scripts have
all finished running, like programs that have ended. The only
sign that they have ever run is the resulting page.

That page may, or may not, contain client side scripts. When the
browser receives the page, it runs the client side scripts. Such
scripts can manipulate how the page looks in the browser, but
they rarely try to contact the server except by making the browser
request a new page.

Client side scripts are very restrained in what they can do. They
can't access files on the computer, nor contact other servers over
the net. They are just running inside the browser. This is a security
measure, since you can't know which scripts to trust.
how can i get my javascript application to send the details of a user
filled form to me without having to have a server side script?
Sending a form is easy, just press submit. It's doing something with
the data that takes scripting. The easiest place to do something about
it is at the server, because server side scripts are not restrained
the same way client side scripts are. A server side script would
be able to send the submitted form to you as an e-mail.

On the client, the best you can do is to make the action of the form
a mailto: link, and that's not a very good solution.
if i have both server side and client side script in a web
application, will the resulting application run as a client or server?
I'm afraid that questions doesn't make sense to me, perhaps because
I'm not sure what is part of the "application".

The web server is a server. The browser is a client. The scripts at
either end manipulate data locally at that end, and communication
between the two ends is HTTP requests and responses.
i know i probably haven't made much sense, but the problem is that i'm
trying to make sense of it all.


Good luck :)

/L
--
Lasse Reichstein Nielsen - lr*@hotpop.com
DHTML Death Colors: <URL:http://www.infimum.dk/HTML/rasterTriangleDOM.html>
'Faith without judgement merely degrades the spirit divine.'
Jul 23 '05 #2
if i have both server side and client side script in a web application,
will the resulting application run as a client or server?...
Liza, we will call it server side. Because the server side script is
beyond our abilty to manipulate we think of the entire page as server
side.

Jul 23 '05 #3
trinity mail wrote:
if i have both server side and client side script in a web application,
will the resulting application run as a client or server?...
The resulting application will "run as" neither client nor server. It will
run the server-side code to produce some content which is sent to the
client. If the resulting content contains client-side Javascript, then that
Javascript is executed on the client (assuming the client understands how to
execute client-side script).
Liza, we will call it server side. Because the server side script is
beyond our abilty to manipulate we think of the entire page as server
side.


This makes entirely no sense to me.

If this is the case, then _all_ Web pages are "server side" (which is true
given the definition above), because you have no ability to edit the static
HTML pages (on the server) sent to you either.

You have to separate your thinking into "what happens on the server" and
"what happens on the client".

Starting with the client first (because I hope it will make more sense to
you this way): the client makes a request to a Web server and receives some
"text/html" content from a Web server (it can receive other types of
content, but let's keep it simple with text/html). It does not matter if
that content is a static HTML document, it was generated by some server-side
processing (such as ASP, JSP, or PHP) or if there are 1,000,000 monkeys
tapping away at keyboards on the server. The client just sees "text/html"
and renders it. If that "text/html" contains client-side <script> tags (of
type "text/javascript"), then maybe that client-side script is executed,
maybe it isn't. But the client doesn't care _how_ the content was generated,
as far as the client is concerned it's all just static HTML pages.

Now for "what happens on the server". The server receives a request for
content and serves it to the client. It may do this by reading and sending a
static HTML page, it may do this by executing Perl, or reading and
interpreting PHP or ASP. It may do this by loading a servlet and running it
inside a Java Virtual Machine or it might shock 1,000,000 monkeys with
electricity to make them start typing. _It does not matter_. The end result
is a document of type "text/html" sent to the client. This document may or
may not contain content of type "text/javascript" between <script></script>
tags. _The server does not care_, it just sends it to the client.

HTTP is not an interaction which is typically called a client/server
application, where a client and server keep a connection between each other
open and can communicate bi-directionally anytime they wish. HTTP is a
"stateless" transaction, and in it's simplest form, data can only travel in
one direction at a time. The client makes a request, the server receives the
request and responds to the request. After that transaction takes place,
neither the client nor the server know or care if the other is still there.
In fact, the server doesn't even care if the client ever receives or
understands the data sent to it.

--
| Grant Wagner <gw*****@agricoreunited.com>

* Client-side Javascript and Netscape 4 DOM Reference available at:
*
http://devedge.netscape.com/library/...ce/frames.html

* Internet Explorer DOM Reference available at:
*
http://msdn.microsoft.com/workshop/a...ence_entry.asp

* Netscape 6/7 DOM Reference available at:
* http://www.mozilla.org/docs/dom/domref/
* Tips for upgrading JavaScript for Netscape 7 / Mozilla
* http://www.mozilla.org/docs/web-deve...upgrade_2.html
Jul 23 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Rina0 | last post by:
Cybersecurity engineering is a specialized field that focuses on the design, development, and implementation of systems, processes, and technologies that protect against cyber threats and...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: lllomh | last post by:
How does React native implement an English player?
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.