Showing posts with label JavaScript. Show all posts
Showing posts with label JavaScript. Show all posts

Tuesday, 11 March 2014

HTML and JavaScript

HTML and JavaScript works together.JavaScript is a Scripting language. That is, the code is not
compiled but instead it appears as ASCII text in an HTMLfile.

JavaScript is used,when you have Scenario such as you have created a website in which you want to give many options to the users and if user chose any option out of them then what action to be performed at that instant, That's where JavaScript matters.

For integrating it into the HTML code, you have three possibilities:

1. Inclusion in header part:

    ==> Incapacitate into header part:   


<html>

<head>

<title>

My Page

</title>

<script language="javascript">

/*

write your code here

functions and methods

*/

</script>

The Tag <script language="JavaScript"> introduces the JavaScript source code, the tag
</script> ends it.

For Second incorporation of JavaScript into html code ,Click Here 

For Further details about JavaScript go to "JavaScript" Label.


First Java Script Program

This is first JavaScript program."alert( )" function used to pop-up the some message.It will display the content written before the script programming than the script will be available with pop-up box.

Program:


<html>
<head>
<title> MY first Javascript Page </title>
</head>
<body>
<h3>
My first javaScript Page
</h3>
<script>
alert("Hello My Page");
</script>
My Second-Half of JavaScript Page
<script>
alert("Hello my Second Half");
</script>
</body>
</html>

Output will Display Like this on Your Browser:




 










Look At the other Programs in JavaScript Label. 

HTML and JavaScript Incorporation

In First Incorporation we have how to include JavaScript in HTML header part.

For Second Possibilities of inclusion of JavaScript in Html Code is you code part.It's just depend on your code to carry out any functionality or any reaction,change in something like to over the mouse of any particular thing then what action has been specified.

In this,When the Web Page loads there is a pop-up alert open and give some reaction tell us something through display message.

<body onload="hello()">
Hello function is to be performed whenever page loads.


For Complete program refer this Link:  Incorporation Program

Third Incorporation of HTML and Java.

Further Fuctionality and programs of JavaScript and HTML refer Divisions.