Page 69 - PortGPT_V2.1_C8_Flipbook
P. 69

Alongside HTML5 and CSS, JavaScript is one of the core languages
                 of the World Wide Web (WWW). It was developed by Brendan                      Tech Fact
                 Eich, a Netscape Communications Corporation programmer, in            There are about 1.7 billion
                 1995. He takes only ten days to develop the language.
                                                                                       websites on the Internet
                                                                                       from which 95% websites
                        FEATURES OF JAVASCRIPT                                              use JavaScript.


                 Some of the important features of JavaScript are as follows:

                     It is used in both client-side and server-side applications.
                     It is platform independent; hence, it runs on many operating systems.

                     It is used with HTML code and run on web browsers.

                     It is a case-sensitive and interpreted language.
                     It is used to validate user input for errors.


                        USING JAVASCRIPT


                 JavaScript cannot run on its own because it is a scripting language, and hence, needs to be embedded
                 within an HTML code.

                 In HTML5, we can use JavaScript in two ways: internally and externally.

                      Internal JavaScript


                 When JavaScript code is written within the HTML web page then it is called internal JavaScript. We
                 use the <SCRIPT> and </SCRIPT> tags to place the JavaScript codes either in the <HEAD> or <BODY>
                 tag of the HTML5 document. The syntax to add internal JavaScript is:
                 <HEAD>
                 <SCRIPT>
                 JavaScript code
                 .....

                 </SCRIPT>
                 <HEAD>
                 OR

                 <BODY>
                 <SCRIPT>
                 JavaScript code
                 .....
                 </SCRIPT>

                 </BODY>






                                                                                          Introduction to JavaScript  67
   64   65   66   67   68   69   70   71   72   73   74