Friday 31 October 2014

vb script practicle tutorial


VBScript
v  VBScript is a Microsoft scripting language.
v  VBScript is the default scripting language in ASP.
v  Client-side VBScript only works in Internet Explorer!!!
<html>
<body>

<script type="text/vbscript">
document.write("This is my first VBScript!")
</script>

</body>
</html>
<html>
<body>

<script type="text/vbscript">
document.write("<font color=green size=7>Hello World!</font>")
</script>

</body>
</html>

<html>
<head>
<script type="text/vbscript">
function choksi()
alert("Hello World!")
end function
</script>
</head>

<body onload="choksi()">

<p>We usually use the head section for functions 
(to be sure that the functions are loaded before they are called).</p>

</body>
</html>




<html>
<head>
<script type="text/vbscript">
function choksi()
document.write("Hello World!")
end function
</script>
</head>

<body>
<input type="button" value="click here" onclick="choksi()">
<p>We usually use the head section for functions 
(to be sure that the functions are loaded before they are called).</p>

</body>
</html>

Program-5  Create A Variable
<html>
<body>
<script type="text/vbscript">
Dim firstname
Dim lastname
firstname="ahmad"
lastname="choksi"
document.write(firstname)
document.write("<br>")
document.write(lastname)
</script>

<p>The script above declares a variable, assigns a value to it, and displays the value. Then, it changes the value, and displays the value again.</p>

</body>
</html>

<body>
<script type="text/vbscript">
Dim name,surname
name="ahmad"
surname="choksi"
document.write("My name is: " & name &"<br>")
document.write("My surname is: " & surname)
</script>
</body>
</html>
Program-7  Create an array
<html>
<body>

<script type="text/vbscript">
Dim famname(5)
famname(0)="Jan Egil"
famname(1)="Tove"
famname(2)="Hege"
famname(3)="Stale"
famname(4)="Kai Jim"
famname(5)="Borge"
document.write(famname(5))
</script>
</body>
</html>
Program-7  Create an array
<html>
<body>
<script type="text/vbscript">
Dim famname(5)
famname(0)="Jan Egil"
famname(1)="Tove"
famname(2)="Hege"
famname(3)="Stale"
famname(4)="Kai Jim"
famname(5)="Borge"
For i=0 To 5
  document.write(famname(i) & "<br />")
Next
</script>
</body>
</html>
Program-8  Sub procedure
<html>
<head>
<script type="text/vbscript">
Sub mySub()
  msgbox("This is a Sub procedure")
End Sub
</script>
</head>
<body>
<script type="text/vbscript">
Call mySub()
</script>
<p>A Sub procedure does not return a result.</p>
</body>
</html>
Program-9  Function procedure
<html>
<head>
<script type="text/vbscript">
Function myFunction()
 myFunction = "BLUE"
End Function
</script>
</head>
<body>
<script type="text/vbscript">
document.write("My favorite color is " & myFunction())
</script>
<p>A Function procedure can return a result.</p>
</body>
</html>

Saturday 18 October 2014

javascript practicle tutorial (choksi ahmad)



JavaScript
Javascript Is THE Scripting Language Of The Web.

Javascript Is Used In Millions Of Web Pages To Add Functionality, Validate Forms, Detect Browsers, And Much More.



<html>

<body>



<script type="text/javascript">

document.write("Hello World!");

</script>



</body>

</html>


 
<html>
<body>
 
<script type="text/javascript">
document.write("<h1>Hello World!</h1>");
</script>
 
</body>
</html>
 
 
 
<html>
<head>
</head>
 
<body>
 
<script type="text/javascript">
document.write("This message is written by JavaScript");
</script>
 
</body>
</html>

<html>
<head>
<script type="text/javascript">
function message()
{
alert("This alert box was called with the onload event");
}
</script>
</head>
 
<body onload="message()">
 
<p>We usually use the head section for functions 
(to be sure that the functions are loaded before they are called).</p>
 
</body>
 
 
 
 
<html>
<head>
<script type="text/javascript">
function message()
{
document.write("MY NAME IS CHOKSI AHMAD");
}
</script>
</head>
 
<body>
<input type="button" value="click here" onclick="message()">
 
<p>We usually use the head section for functions (to be sure that the functions are loaded before they are called).</p>
 
</body>
</html>


<html>
<body>
 
<script type="text/javascript">
document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph.</p>");
document.write("<p>This is another paragraph.</p>");
</script>
 
</body>
</html>


<html>
<body>
 
<script type="text/javascript">
// Write a heading
document.write("<h1>This is a heading</h1>");
// Write two paragraphs:
document.write("<p>This is a paragraph.</p>");
document.write("<p>This is another paragraph.</p>");
</script>
 
</body>
</html>


<html>
<body>
 
<script type="text/javascript">
/*
The code below will write
one heading and two paragraphs
*/
document.write("<h1>This is a heading</h1>");
document.write("<p>This is a paragraph.</p>");
document.write("<p>This is another paragraph.</p>");
</script>
 
</body>
</html>
 
 
 
 
 
    javascript practicle tutorial