One Meeting With Javascript
One Meeting With Javascript
One Meeting With Javascript
Client-Server Programming
● Client side
programming/scripting
– a program or a
script is executed
at the client side
– in a web
application this is
usually UI-
related/page-
content
modification tasks
Client-Server Programming
● ECMAScript /
Javascript
– Created by Brendan
Eich for Netscape
– Originally Mocha,
then LiveScript, then
Javascript
– Included in Netscape
Navigator 2.0
Client Side Scripting
● ECMAScript / Javascript
– Microsoft came out with Jscript in MSIE 3
– Submitted to ECMA for standardization
– ECMA-262 Specification
– ECMAScript is a compromise name.
Client Side Scripting
● VBScript
– in MSIE
● PerlScript*
Javascript
<html>
<head>
...
<script type=”text/javascript”>
<!--
function myFunction() {
}
-->
</script>
Javascript Embedding
<html>
...
<head>
<link rel=”javascript” href=”jsfile.js”
type=”text/javascript” />
</head>
...
Javascript Embedding
<form onsubmit=”script”>
...
● AJAX
– Asynchronous Javascript And XML
– A means of communicating with the server
asynchronously.
● JSON
– Javascript Object Notation
● Javascript DOM (Document Object Model)
– This is a standard API.
Examples: JS DOM
function changeStyle(objID) {
//standard DOM method
var el = document.getElementById(objID);
}
Example: JS DOM
<form name=”myform”>
<input type=”checkbox” checked=”false”
name=”chk” />
<input type=”button” onclick=
”doc um ent.m yform .c hk .c hec k ed='true'”
/>
</form>
Example: JSON
if ( http_request.readyState == 4 ) {
if ( http_request.status == 200 ) {
the_object =
http_request = null;