Welcome friends...
In this post we will see types of java script and more....
Types of Java Script
Java Script can classified into two types
1.Internal Java Script
2.External Java Script
Internal Java Script
Using <script> element placed code directly into the page or document.
<html>
<head>
<script type="text/javascript">
</script>
</head>
<body>
<script type="text/javascript">
</script>
</body>
</html>
External Java Script
- The external java script is external file.
- The external java script file extension is .js
- The external java script can be inserted inside the <head></head>.
- The external java script file can be inserted into multiple pages.
- The external java script insert in following way
Syntax:
<head>
<script src="external javascript file path"></script>
</head>
Example:
1.external.js
// JavaScript Document
function show()
{
alert("welcome to my blog");
}
2.Index.html
<html>
<head>
<script src="external.js"></script>
<title>Java Script Examples</title>
</head>
<body onload="show()">
</body>
</html>
Important Rule of Java Script:
- Java Script statements can be grouped together in blocks
- Java Script is case-sensitive.
- Sometime java script act not case sensitive in some cases.
- Java script ingore's extra spaces
- Java script break up a code we can use backslash(/).
- Java script code each line ends with semo colon(;).
- Java script variables and function names do not start with number.
- Java script variables and function names do not used Java Script Reserved keyword like var,function
Java Script Comment line:
- Basically comment line are used to developers in future refrence.
- Java script comments will not executed browser. the browser ignored comment lines.
- Types of Java script comment line
- Singleline- Its used in single line and its Denoted by //
- Multi line- Its used for set of code. Its Denoted /* codes*/
Ok friends...
NOTE:
Am list out Full java script syllabus.. if you learn full follow the below list out and workout the more examples.if you want any examples please comments here i will post after. the below topics are very basics so am post after section some important scripts and concepts only.
JAVA SCRIPT Syllabus:
JAVA SCRIPT Basics
- JS Introduction
- JS History
- JS Variables
- JS Data types
- JS Operators
- JS Conditional Statements
- JS Control Statements
- JS Function
- JS Arrays
- JS Exeception Handling
JAVA SCRIPT Advanced
- JS Browser
- JS Cookies
- JS Validation
- JS Timing
- JS Objects
I will post some important concepts in above list please watch all lession..
Thank you