Presentation is loading. Please wait.

Presentation is loading. Please wait.

JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting.

Similar presentations


Presentation on theme: "JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting."— Presentation transcript:

1 JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting language... programs run on the web server computer) A program in the client's browser can do various useful tasks: - validating user input to text boxes in on-screen forms - modifying parts of the web page, e.g. in response to user actions (DHTML) - fetching data items from the server, as a background task (AJAX) Doing work on the client computer can speed-up Web Database Applications.. avoids data transfer delays and server workload delay. We need to know about JavaScript in order to use the Google Maps API.. and also to use AJAX.

2 JavaScript programs are included in web pages.. in two alternative ways: 1. As program code inside a.. element (between these two tags). 2. As a separate.JS program that is included as the page loads. > An HTML document has a.. section and a.. section. -- the body section contains the inforamtion displayed on screen -- the head contains various definitions. JavaScript can be embedded in the head or the body of a web page.. but behaves differently in each case: Code in the body section is executed immediately, as the program loads Code in the head is a collection of function definitions, to be called later.. e.g. when particular events occur. >

3 JavaScript can be used to respond to events >

4 Hello HTML tags can have IDs: This allows JavaScript to change parts of the web page: <input type='button' value='make Hello blue' onClick='JavaScript: document.getElementById("hello").color="blue" ' > As well as reading properties of the tag.. Including properties such as the position and area occupied by the tag’s object on the web page on screen. example


Download ppt "JavaScript is a client-side scripting language. Programs run in the web browser on the client's computer. (PHP, in contrast, is a server-side scripting."

Similar presentations


Ads by Google