1. JavaScript OverviewWhatis JavaScript ? JavaScript started life as LiveScript, but Netscape changed thename, possibly because of the excitement being generated byJava.to JavaScript. JavaScript made its first appearance inNetscape 2.0 in 1995 with a name LiveScript. JavaScript is a lightweight, interpreted programming languagewith object-oriented capabilities that allows you to buildinteractivity into otherwise static HTML pages. The general-purpose core of the language has been embeddedin Netscape, Internet Explorer, and other web browsers
2.
JavaScript is: JavaScriptis a lightweight, interpreted programming language Designed for creating network-centric applications Complementary to and integrated with Java Complementary to and integrated with HTML Open and cross-platform
3.
Client-side JavaScriptis the most common form of thelanguage. The script should be included in or referenced by anHTML document for the code to be interpreted by the browser. It means that a web page need no longer be static HTML, butcan include programs that interact with the user, control thebrowser, and dynamically create HTML content. The JavaScript code is executed when the user submits theform, and only if all the entries are valid they would besubmitted to the Web Server. JavaScript can be used to trap user-initiated events such asbutton clicks, link navigation, and other actions that the userexplicitly or implicitly initiates.Client-side #"https://www.slideshare.net/slideshow/js-slides_for_begineers_javascript-1-ppt/278227907#4">Advantages of #"https://www.slideshare.net/slideshow/js-slides_for_begineers_javascript-1-ppt/278227907#5">Limitations with #"https://www.slideshare.net/slideshow/js-slides_for_begineers_javascript-1-ppt/278227907#6">JavaScript Development Tools:One of JavaScript's strengths is that expensive developmenttools are not usually required. You can start with a simple texteditor such as Notepad. Since it is an interpreted language inside the context of a webbrowser, you don't even need to buy a compiler. To make our life simpler, various vendors have come up withvery nice JavaScript editing tools. Few of them are listed here:– Microsoft FrontPage– Macromedia Dreamweaver MX– Macromedia HomeSite 5– Yaldex Software Inc., Free JavaScript Editor
7.
2. JavaScript SyntaxA JavaScript consists of JavaScript statements that are placed withinthe <script>... </script> HTML tags in a web page. You can place the <script> tag containing your JavaScript anywherewithin you web page but it is preferred way to keep it within the<head> tags. The <script> tag alert the browser program to begin interpreting allthe text between these tags as a script. So simple syntax of yourJavaScript will be as follows (next slide)
8.
<script language="javascript"type="text/javascript">JavaScript code</script>Thescript tag takes two important attributes: language: This attribute specifies what scripting language you areusing. Typically, its value will be javascript. Although recent versions ofHTML (and XHTML, its successor) have phased out the use of thisattribute. type: This attribute is what is now recommended to indicate thescripting language in use and its value should be set to "text/javascript".
9.
Your First JavaScriptScript:<html><body><script language="javascript"type="text/javascript"><!--document.write("Hello World!")//--></script></body></html>
10.
JavaScript ignoresspaces, tabs, and newlines that appear inJavaScript programs. Because you can use spaces, tabs, and newlines freely in yourprogram so you are free to format and indent your programs ina neat and consistent way that makes the code easy to readand understand.Semicolons are Optional: Simple statements in JavaScript are generally followed by asemicolon character, just as they are in C, C++, and Java.JavaScript, however, allows you to omit this semicolon if yourstatements are each placed on a separate line. For example, thefollowing code could be written without semicolonsWhitespace and Line Breaks:
11.
• JavaScript isa case-sensitive language. This means thatlanguage keywords, variables, function names, and any otheridentifiers must always be typed with a consistent capitalizationof letters.• So identifiers Time, TIme and TIME will have different meaningsin JavaScript.• NOTE: Care should be taken while writing your variable andfunction names in JavaScript.Case Sensitivity: