What is JavaScript?

JavaScript is a conservative, item based scripting language for Web pages. JavaScript code installed into your HTML pages can improve them with numerous fascinating components, from swapping pictures when you move a cursor over them, to multi-level drop-down menus.

You can make truly advanced and practically application-like pages with the assistance of JavaScript. You needn't bother with any extraordinary programming other than a content manager and a Web program, and you needn't bother with access to a Web server. You can make and test all your JavaScript code right all alone PC.

The downsides of JavaScript
At this time the most concerning issue is the blemished JavaScript usage that today's programs offer. Though all real programs that are form 3.0 or higher incorporate JavaScript support, they manage JavaScript in an unexpected way.
Indeed, distinctive adaptations of the same program handle JavaScript in an unexpected way. This makes it hard to make a convoluted JavaScript code that work over all programs. So dependably check your pages on whatever number diverse programs (and even stages) as could be expected under the circumstances.

What do JavaScript code resemble? 
Like HTML, JavaScript is just content that can be written into a word processor. Its code is installed in HTML inside a <SCRIPT> tag. Some old programs don't comprehend this tag. To keep them from regarding your JavaScript as HTML, dependably utilize this trap including HTML remarks.

Therefore
  1. JavaScript is a lightweight, translated programming language.
  2. Open and cross-platform.
  3. Intended for making system driven applications.
  4. Reciprocal to and coordinated with Java.
JavaScript Syntax

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 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 all the text between these
tags as a script. So simple syntax of your JavaScript will be as follows

<script ...>
    JavaScript code
</script>

The script label takes two imperative attributes:
  1. Language: This property indicates what scripting dialect you are utilizing. Commonly, its quality will be javascript. Albeit late forms of HTML (and XHTML, its successor) have eliminated the utilization of this trait.
  2. Type: This language is what is currently prescribed to show the scripting language in use and its esteem ought to be set to "text/javascript"
Therefore finally our above script become

<script language="javascript" type="text/javascript">
    JavaScript code
</script>

A simple example of JavaScript is:

<html>
    <body>
        <script language="javascript" type="text/javascript">
        <!--
           document.write("Hello World!")
           //-->
        </script>
    </body>
</html>

Output:

Hello World!

Post a Comment Blogger

 
Top