Title: 5555: Web Programming
15555 Web Programming
2- program runs in web-browser - no server
control once downloaded - less bandwidth -
insecure
- program runs on web server - uses more
resources - has no control over client
machine - secure
3Client-Side
- Widely-used, particularly for DHTML -
Full-featured language - Cross-platform support
- Used in the form of applets on web pages -
Slow, but good with graphics - Requires
runtime-environment, but is cross-platform
- Microsoft OS only, hence limited applicability
4Server-Side 1 - CGI
- Most widely-used server scripting language on
the internet - Large number of add-on libraries -
Works on Windows and Unix - OpenSource
- - rapidly-growing
- - HTML-embedded
- - Works on Windows and Unix
- OpenSource
- Object-oriented many useful classes available
free on web
- - MS-specific (i.e. Windows only, AND Windows
web-servers only - HTML-embedded
- Can run uner Unix with Chillisoft (expensive)
5Server-Side 2
- Cult following. Similar to Perl in use
smaller user base. - Can run under Windows or Unix
- Application server
- Good for non-programmers
- Can link easily to various database back-ends
- growing userbase
- requires add-on libraries for server
6Server/Client
- uses XML
- Asynchronous Javascript And XML
7Client/Server Interaction
CLIENT
SERVER
http//143.52.5.51/index.html
Client issues a request for a page
Server returns requested page
Client clicks a link to another page
Server returns requested page
etc
8(No Transcript)
9TEMPERATURE EXAMPLE The HTML code
ltbodygt lth1gtltfont color"Green" face"Verdana"
Size"4"gtltbgtTemperature Converterlt/bgtlt/fontgtlthr
size"1"gtlt/h1gt Insert a number in either input
field, and the number will be converted into
either Celsius or Fahrenheit. ltpgtlt/pgt ltform
name"myform"gt ltinput name"celsius"
onkeyup"convert('C')"gt degrees Celsius ltpgtis
equal tolt/pgt ltinput name"fahrenheit"
onkeyup"convert('F')"gt degrees Fahrenheit
lt/formgt Note that the ltbgtMath.roundlt/bgt method
is used, so that the result will be returned as a
whole number. lt/bodygt lt/htmlgt
10TEMPERATURE EXAMPLE The Javascript
ltscript type"text/javascript"gt function
convert(degree) if (degree"C")
Fdocument.myform.celsius.value 9 / 5
32 document.myform.fahrenheit.valueMath.round(F)
else C(document.myform.fahrenheit.valu
e -32) 5 / 9 document.myform.celsius.valueMath
.round(C) lt/scriptgt