Introduction To JavaScript
📘 JavaScript – Basics & Concepts
🔹 JavaScript
JavaScript is event driven language and case sensitive language. Let us see how JavaScript can overcome the drawbacks of CSS-
🔹 Drawbacks of CSS
CSS can not handle events,it is only used to style the webpage.
Events can not be performed with the help of CSS.
e.g- EVENTS means if i click in any button so some action has to be performed.
Instead JAVASCRIPT is event handler language.
🔹 Where do we apply JavaScript?
JavaScript is applied in HEAD section within script tag.
<head>
<script language="JavaScript">
/*......*/code
</script>
</head>
🔹 JavaScript Popup Boxes
document.write(" ")
alert(" ")
confirm(" ")
prompt(" ")
🔹 Modal Window
The mini-window with the message is called a modal window.
The word “modal” means that the visitor can’t interact with the rest of the page, press other buttons, etc, until they have dealt with the window. In this case – until they press “OK”.
🔹 Variable
variable is the name of memory location , where user can store different type of data value.
e.g- a=10,a=ram,a=10.7
🔹 Types of Variable
1) Variant
Variant is a type of variable in which a variable stores a definite value of data type specified.
e.g- int a, char b and etc.
2) Non-Variant
Non-Variant is type of variable in which data type depends upon the value of variable.
e.g- var a=10.5[here the data type becomes float]
ex-
dim a as integer;(variant)
dim a as(non-variant)
*JavaScript supports non- variant variables.
🔹 Events Handling using Functions
Events can be handled with the help functions-
<html>
<head>
<script language="JavaScript">
function()
{
document.write("welcome to my webpage");
}
<script>
</head>
<body>
<input type="button" value="submit" onclick="display();">
</body>
</html>
🔹 Separators
variable separator(",")
array separator("[]")
block separator("{}")
function separator("()")
Comments
Post a Comment