Javascript Introduction

JavaScript is Netscapes cross platform object based scripting language for client and server applications.

JavaScript has following features:

  • JavaScript is an easy to use language
  • JavaScript is not a form of Java
  • JavaScript is a Object based language and is not compiled and is a purely interpreted language
  • Script is embedded directly into the HTML pages and interpreted by the browser at runtime
  • JavaScript is 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

Javascript Tag

A JavaScript consists of JavaScript statements that are placed within the <script>... </script> HTML tags in a web page. You can place the <script> tag containing your JavaScript anywhere within your web page and keep it within the <head> tags. The <script> tag alert the browser program to begin interpreting all the text between these tags as a script.

The script tag takes two attributes

  • Language: This attribute specifies what scripting language we are using. Basically, its value will be javascript.
  • Type: This attribute is to indicate the scripting language in use and its value should be set to "text/javascript".

JavaScript statement will look like

<script language="Javascript">
 JavaScript statements.....
<script>

This is the most common way of using JavaScript on HTML pages.

To use JavaScript file in HTML code:

<html>
<head>
<title>My first Javascript code</title>
<Script SRC="myCode.js">
</Script>
</head>
<body>
</body>
</html>

JavaScript expression

The expression is preceded by an & and followed by ; and enclosed in curly braces {}

<H2/>&{myTitle};</H2>

Here myTitle is a JavaScript variable.

Event handlers in some HTML tags

<html>
<head>
<title>My first Javascript code</title>
</head>
<INPUT TYPE = "button" VALUE="click" 
onClick="Javascript:javascriptFunction();">
<body>
</body>
</html>

Javascript allows more than one statement which can be included by separating with a semicolon ";"

See Also

Javascript Built in String Object
Javascript Built in Number Object
Javascript Built in Math Object
Javascript Built in Date Object
Javascript Built in Arrays Object
Javascript Built in Boolean Object
Javascript Built in RegExp Object
Javascript Built in JSON Object


 
 
SHARE THIS IF YOU LIKE!
submit to reddit
SUBSCRIBE FOR LATEST UPDATES
HAVE WE CONNECTED ON FACEBOOK?
TOP TUTORIALSTOP CODE EXAMPLESTOP LIVE DEMOLINKSSTAY CONNECTED
HTML Tutorial
HTML5 Tutorial
Bootstrap3 Tutorial
Javascript Tutorial
TypeScript Tutorial
AngularJS Tutorial
CSharp Tutorial
PHP Tutorial
Developer Tools
Javascript
AngularJS
Google MAP API V3
ASP.NET
Javascript
AngularJS
Google MAP API V3
Contact Us
Advertise with Us
Privacy Policy
Disclaimer
Stay connected. We actually like you. If you want to get up to the minute updates, then connect with us on your fav below.
 
Twitter   Linkedin   Facebook   Google+    RSS   Pinterest
 
Protected by Copyscape Original Content Checker
 
 
Copyright ©2017 www.techstrikers.com Unauthorized reproduction/replication of any part of this site is prohibited.