Wednesday, 15 October 2008

Tutorial 3

Combobox reset

Options.html was extended to include an image that will reset the combobox to the original format.

There two way that I found:

1. <a href="#" ><img src="Image4.JPG" onClick="window.location.reload()"/></a>
--> this will reload the page so then the ComboBox will change to the original format

2. Creating submit button which then  call reset function:

Tutorial 2


This content is focussed on JavaScript events and basic Ajax:

All content here (AJAX sample) delivered to the browser over the HTTP protocol and not using the FILE protocol because the JavaScript makes use of HTTP requests through the XMLHttpRequestObject. 

Taking the list of Javascript events here and the file blusher.html, implement four new event handlers.

Event 1: onLoad can be use to run script as soon as the page is loaded. such as getting data from the server.

Event 2: onclick can be use to increase user setisfaction. such as calling javascript function to validate data.

Event 3: onChange can also be use to validate form, such as the value's input box will be validated as soon as it change

Event 4: onClick can also be use to to change back gound colour. this could be usefull for people to change the background colour of a website acording to their style.

Ajax error hendling

The file ajaxbutton.html was requested to a non-existent file from the server. When button has been pressed nothing happen.

Ajax provide basic error handling which incase this error occure. Providing as follow:


 Error message provided if HTTP status = 404

so by createing else which mean that http status = 404 is included.












Ajaxbutton2.html

A second button was added to ajaxbutton2.html, when the button is pressed, it display a second image in specify area.The getData() function was re-used but the paramater  is diferent (show on picture below)


Tutorial 1

Creating databases by using phpmyadmin