Page 122 - CITS - Computer Software Application -TT
P. 122

COMPUTER SOFTWARE APPLICATION - CITS




           •  Declarative programming – In this type of language we are concerned about how it is to be done, basically
              here logical computation requires. Her main goal is to describe the desired result without direct dictation on
              how to get it as the arrow function does.
           How to Link JavaScript File in HTML ?
           JavaScript can be added to HTML file in two ways:
           •  Internal JS: We can add JavaScript directly to our HTML file by writing the code inside the <script> tag. The
              <script> tag can either be placed inside the <head> or the <body> tag according to the requirement.
           •  External JS: We can write JavaScript code in another files having an extension.js and then link this file inside
              the <head> tag of the HTML file in which we want to add this code.

           Syntax:
           <script>
               // JavaScript Code
           </script>

           Example:
           •  HTML
           <!DOCTYPE html>
           <html lang=”en”>
           <head>

               <title>
                   Basic Example to Describe JavaScript
               </title>
           </head>

            <body>
               <!-- JavaScript code can be embedded inside
                   head section or body section -->
               <script>
                   console.log(“Welcome to NSTI”);
               </script>

           </body>
           </html>
           Output: The output will display on the console.
           Welcome to NSTI

           History of JavaScript
           It was created in 1995 by Brendan Eich while he was an engineer at Netscape. It was originally going to be named
           LiveScript but was renamed. Unlike most programming languages, JavaScript language has no concept of input
           or output. It is designed to run as a scripting language in a host environment, and it is up to the host environment
           to provide mechanisms for communicating with the outside world. The most common host environment is the
           browser.
           Features of JavaScript
           According to a recent survey conducted by Stack Overflow, JavaScript is the most popular language on earth.
           With advances in browser  technology  and  JavaScript  having  moved  into the server with Node.js  and  other
           frameworks, JavaScript is capable of so much more. Here are a few things that we can do with JavaScript:



                                                           109

                             CITS : IT&ITES - Computer  Software Application - Lesson 37 - 46
   117   118   119   120   121   122   123   124   125   126   127