Showing posts with label AJAX. Show all posts
Showing posts with label AJAX. Show all posts

Tuesday, 10 June 2008

JavaScript

JavaScript is a C based language. It is not strongly typed. It does support object orientation. It is a client side scripting language like VBscript.
The Wikipedia article on JavaScript is here.




METHODS
document.write("Testing");
window.alert("Test Message"); - displays a pop-up window.

Variables
Variables are not stongly typed.
This is an example of declaring them:
var x =0; //Declares variable and sets value to zero.
x="Hello"; //resets the same variable to a string value.
x=true; //Example of assigning a boolean value

FLOW CONTROL
Switch - similar to the case statement in VB.net
If
For.. Next
Loop

AJAX - what it is and other definitions

AJAX stands for Asynchronous Javascript and XML.

It involves several components including:
  1. DOM - Document Object Model. This is on the client side and is modified by JavaScript to dynamically change what the users sees.
  2. XMLHttpRequest - this send and receives data to/from the server in the background. This does not require the page to be reloaded as is the case with the traditional HTML Post method.
  3. XML - or other format, for sending data back to server. It does not have to be XML format.
---------------------------------------------------------------------------------------------
Mashup - Combine output from several sites - using their APIs
JavaScript - the only script supported by all the major browers. IE, Firefox, Opera, Safari. There are cicumstances where it may not be supported, for example, the user may have disabled JavaScript in their brower, or they could be using a mobile phone.