1 / 4

JavaScript is a client-side scripting language.

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:

padma
Télécharger la présentation

JavaScript is a client-side scripting language.

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

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 <script> .. </script> element (between these two tags). 2. As a separate .JS program that is included as the page loads. << examples of the two uses for script tags >> An HTML document has a <head>..</head> section and a <body> .. </body> 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. << examples of head and body code >>

  3. JavaScript can be used to respond to events << examples of onClick and other events >>

  4. HTML tags can have IDs: <center> <h3><font color='brown' id='hello'> Hello </font></h3> </center> 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

More Related