Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Javascript Conditions In Java Script

Related Tutorials


 
 

Share on Google+Share on Google+

Conditions In Java Script

Advertisement
In this article you learn the basics of JavaScript and create your first JavaScript program.

Conditions In Java Script

     

In this article you learn the basics of JavaScript and create your first JavaScript program.

About JavaScript

Java Script is Netscape's Cross - platform, Object - based Scripting language for Client and Server applications. It is a Case sensitive application. JavaScript programs are usually embedded directly in HTML files. The script executes when the user's browser opens the HTML file. JavaScript is different from the Java language. Now the biggest problem is the imperfect JavaScript implementations that today's browsers offer. Although all major browsers that are version 3.0 or higher include JavaScript code support, they deal with JavaScript differently. In fact, different versions of the same browser handle JavaScript differently. This makes it difficult to create a complicated JavaScript code that work across all browsers. So always check your pages on as many different browsers (and even platforms) as possible.

The Simple Example to display the Sum of two Digits :-

<html>
<head>
<script language="javascript">
function showAlert()
{
val1=20;
val2=10;
document.write("sum="+(val1+val2));
}
</script>
</head>
</body>

<script type="text/javascript">

showAlert();

</script>

</body>
</html>

JavaScript code is embedded in HTML within a <SCRIPT> tag. It can be used to any number of JavaScript Statements. showAlert() is a function to use in JavaScript language. Val1 and Val2 is a data type. we take the value 20 and 10 in val1 and val2. Document.write is also a function to use  print the Message and values. The result is 20 display on the Screen.

 

Advertisement

If you enjoyed this post then why not add us on Google+? Add us to your Circles



Liked it!  Share this Tutorial


Follow us on Twitter, or add us on Facebook or Google Plus to keep you updated with the recent trends of Java and other open source platforms.

Posted on: December 18, 2008

Related Tutorials

Discuss: Conditions In Java Script  

Post your Comment


Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Comments:1
pavan
July 12, 2012
pavan

pavan
DMCA.com