SHARE

what is Javascript

Javascript is a scripting language . It is object oriented programming language . Javascript is the programming language used for web development in markup languages such as HTML .

Learn what is programming 

Programming makes the sense to computers that what can do , and on which sequence .

JavaScript is very powerful and easy to learn language.

Example Javascript Code

javascript code is used in two ways . Inline code and external javascript code. This sample code is display hello word on screen .

Inline javascript

In inline script , code is written in the html page in which code is used .

<html>
<head>
<script type="text/javascript">
public class HelloWorld
{
public static void main(String[] args)
{
System.out.println("Hello World!");
}
}
</script>
</head>
<body>
</body>
</html>

External code

In external JS an external file is create is created with extension .js  . In this example javascript code is saved in small.js and linked in html code in head section .

<html>
<head>
<script type="text/javascript" src="small.js"> </script>
</head>
<body> <div> Hello, world! </div>
</body>
</html>

And external small.js file source code . Following code is saved in file small.js without script tag . File extension must be .js

public class HelloWorld
{
public static void main(String[] args) {
System.out.println("Hello World!");
} }

In this example

Usage of javascript

With use of JS developer can create a dynamic design for his web content or website . It is use to fix browser problems by checking them .

Java Script is also working when you are offline . Using this feature you can serve better offline web content to your visitors .

It can interact with forms and help to get or display result of user input . When user do any activity on your webpage is called user input .