Thursday 19 May 2011

JAVASCRIPT : What is JavaScript What Can JavaScript Do



What is JavaScript?

Was designed to add interactivity to HTML pages.
Is a scripting language (a scripting language is a lightweight programming language).
JavaScript code is usually embedded directly into HTML pages.
JavaScript is an interpreted language (means that scripts execute without preliminary compilation).

What can a JavaScript do?

JavaScript gives HTML designers a programming tool.
JavaScript can put dynamic text into an HTML page.
JavaScript can react to events.
JavaScript can read and write HTML elements.
JavaScript can be used to validate input data.
JavaScript can be used to detect the visitor's browser.
JavaScript can be used to create cookies.

How to put a JavaScript code into an HTML page?

Use the <script> tag (also use the type attribute to define the scripting language)
<html>
<head>
<script type="text/javascript">
...
</script>
</head>
<body>
<script type="text/javascript">
...
</script>
</body>
</html>
Where Do You Place Scripts?

• Scripts can be in the either <head> section or <body> section
• Convention is to place it in the <head> section
<html>
<head>
<script type="text/javascript">
....
</script>
</head>

2 comments:

  1. Sir i am insert image and some text value database then i want fetch image and name from database

    ReplyDelete
  2. It was such a privilege php notes an honor to celebrate Mother's Day this year with my wonderful mother, grphp notesmother, php notes mother-in-law. php notes I'm also humbled php notes grateful at the opportunity God has given me to be Jackson's mother!

    ReplyDelete