473,763 Members | 6,401 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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 1335
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 "applicatio n".

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/rasterTriangleD OM.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*****@agrico reunited.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
9386
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
9997
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
9822
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7366
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5270
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5405
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3917
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
3522
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2793
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.