Drop Down MenusCSS Drop Down MenuPure CSS Dropdown Menu

Thursday 26 September 2013

Jquery


Jquery is a new kind of javascript library.

Jquery is a fast and concise javascript library that simplifies html document traversing,event handling,animating and ajax interaction for rapid web development.jqyery is designed to change the way that you write in javascript.

cross browser
css3 compliant
lightweight footprint

Saturday 21 September 2013

PROMPT IN JAVASCRIPT

PROMPT

--without alert

<!DOCTYPE html>
<html>

     <head>

   
<title></title>

<head>


<body>
<script type="text/javascript">
function anu()
{

var age=prompt("What is your Age?");

//alert("Hello your age is "+ age);
}


</script>


<form>
 
<input type="button" value="click me" onclick="anu()">
 
</form>

</body>



</html>





















--with alert






















===================================================================


<!DOCTYPE html>
<html>

     <head>
   
<title></title>

<head>


<body>
<script type="text/javascript">
function anu()
{

var yourage=prompt("What is your Age?");
var age=18;
var youngold=age-yourage;
if(youngold > 0)
{
alert ("you are still "+(age-yourage) +" years young to see adult movie");
}
else
{
alert("you can watch adult movie");
}

}


</script>

<form>
 
<input type="button" value="click me" onclick="anu()">
 
</form>

</body>


</html>

OUTPUT :





















Function in Javascript


FUNCTION 


<!DOCTYPE html>
<html>

     <head>
   
<title></title>

<head>


<body>
<script type="text/javascript">
function anu()
{
//pop up
alert("its a pop up");


}

anu();
</script>

 

</body>


</html>












=========================================================



<!DOCTYPE html>
<html>

     <head>
 
<title></title>

<head>


<body>
<script type="text/javascript">
function anu()
{
//pop up
alert("its a pop up");


}


</script>

<form>

<input type="button" value="click me" onclick="anu()">

</form>

</body>


</html>









String in Javascript


STRING IN JAVA SCRIPT


<!DOCTYPE html>
<html>

     <head>
 
<title></title>

<head>

<body>
<script type="text/javascript">


var name="anurag";

var country="loves india"

document.write(name +" "+ country +" " +"that is obvious");


</script>



</body>


</html>

















variables in javascript




<!DOCTYPE html>
<html>

     <head>
 
<title></title>

<head>


<body>
<script type="text/javascript">
<!--


var x= 45;

document.write(x);
//-->
</script>


</body>


</html>





























==============================================



<!DOCTYPE html>
<html>

     <head>
 
<title></title>

<head>


<body>
<script type="text/javascript">

//you cant do below statement...
//var str= "i love my "india"";

// you have to use excape characters

var str= "i love my \"india\"";


document.write(str);


</script>



</body>


</html>




escape character used













==============================================
<!DOCTYPE html>
<html>

     <head>
 
<title></title>

<head>


<body>
<script type="text/javascript">
function anu()
{

var a=50;
var b=40;
var ans=a+b;
alert(ans);

}


</script>

<form>

<input type="button" value="click me" onclick="anu()">

</form>

</body>

</html>


































Basic Javascript

--Some of the basic things
--We write JavaScript for web purposes. scripting language to make webpages more interactive.
--use text editior(notepad ++)


Standard Html format



<html>

         <head>
  
<title>javascript</title>

 <head>

<body>

hello

</body>

</html>









--we can write Javascript anywhere (inside body,inside head)
--In an internet you can add lot of different scripts. Javascript is one of them. When a browser comes across   the code ..we need to tell it explicitly that we are going to work with javascript.

--so use the attribute type

<script type="text/javascript">
<script>

------------------------------------------------------------------------------------------



<!DOCTYPE html>
<html>

     <head>
 
<title></title>

<head>


<body>
<script type="text/javascript">

document.write("i am using javascript");

</script>



</body>


</html>