Showing posts with label what can a Javascript do. Show all posts
Showing posts with label what can a Javascript do. Show all posts

Wednesday, 10 June 2020

What is JavaScript used for in web design - Online Help

What is JavaScript used for in web design:

Hello, readers in this post we will gonna see what is JavaScript used for in web design. let's get started.

What is JavaScript used for in web design - Online Help

The primary use of JavaScript is to write functions that are embedded in or included from HTML pages and interact with the document object model(DOM)of the page. Some simple examples of  this usage are:
  • Opening or popping up a new window with programmatic control over the size, position, and attributes of the new window(i.e. whether the menus, toolbar, etc are visible). 
  • Validation of web form input value to make sure that they will be accepted before they are submitted to the server.
  • Changing images as the mouse cursor moves over them: This effect is often used to draw the user's attention to important links displayed as graphical elements.
Because JavaScript code can run locally in the user's browser(rather than on the remote server) it can respond to user action quickly, making an application feel more responsive.

Furthermore, JavaScript code can detect user actions with HTML alone cannot, such as individual keystrokes.

An application such as Gmail takes advantage of this: much of the user interface logic is written in JavaScript, and Javascript dispatches requests for the information(such as the content of an email message) to the server.

So guys let's see what can a Javascript do.

Also read:  Multithreading in java

what can a JavaScript do:

JavaScript gives web developers a programming language for the use in the web pages and allows them to do the following:

JavaScript gives HTML designer a programming tool: 

HTML authors are normally not programmers, but JavaScript is a scripting language with a very simple Syntax! almost anyone can put simple "snippets" of code into their HTML pages.


JavaScript can put dynamic text into HTML pages:   

A JavaScript statement like this: document.write("<h3>"+name+"</h3>") can write a variable text into HTML page.


JavaScript can react to events:

A JavaScript can be set to execute when something happens like when a page has finished loading or when a user clicks on the HTML element.


JavaScript can read and write HTML elements:

A JavaScript can read and change the content of the HTML element.

Also Read: Thread in java

JavaScript can be used to validate data:

A JavaScript can be used to validate form data before it is submitted to the server. This saves the server from extra processing.


JavaScript can be used to detect the visitor's Browser:

A JavaScript can be used to detect the visitor's browser and depending on the Browser-load another page specifically designed for that browser.


JavaScript can be used to create cookies:

A JavaScript can be used to store and retrieve information on the visitor's computer.

Also read: Exception handling in java

So guys here I had briefly explained what is JavaScript used for in web design. I hope you guys understand the uses of JavaScript in web design if you have any doubts please comment in the comment section below. Thank you for visiting and reading my site.

Posts you may like: