• Image 1
  • Image 2
  • Image 3
  • Image 4
  • Image 5
  • Image 6
  • Image 7




Showing posts with label JAVASCRIPT. Show all posts
Showing posts with label JAVASCRIPT. Show all posts

Wednesday, September 5, 2012

JAVASCRIPT - INTRODUCTION FOR NEWBIE


Hi.. hi.. hi.. welcome my friend at my blog.. You are on “We Are Knowledge”… likely name of my blog is “We Are Knowledge”. In here (this blog) I was provided you many IT knowledge.. I was provided you IT knowledge from program language based web programming until program language based dekstop programming . You are can getting all in here.

This is the right blog for you, if you will be IT programmer, because in here (blog) to be found element for begginer. Yes.. that the right.. let’s search in my page, you will find it.. I was making for you..

Javascript is syntax we to be found in HTML or PHP. Usually the programmer using this for giving the good view of his blog. Because with javascript we are can making the photo or image can move, blink, change become other picture or image.

Many ways we can do with javascript.. in javascript also to be found operators. You know the operators ??? operator is syntax to perform the calculation, be it added, for, less or multiplication. And syntax operator in javascript not so different with other program language like as : cobol, c++.

For starting making javascript we are can made this syntax :

<script type = "text/javascript">

We can put this syntax in “body” of HTML or PHP. And likely all syntax in PHP and HTML.. we must using “closing” for finishing the syntax. And this syntax

</script>

But the javascrit also can we are put in head part of HTML or PHP. And usually if you put in here, you will find the syntax that is long enough about javascript

Ok I think it.. for introduction javascript. I hope you readingmy other article about javascript andother article about IT knowledge…
and I hope too you will getting what do you want…

Don’t forget to came back..
See you later

Thursday, July 12, 2012

TUTORIAL JAVASCRIPT - MANAGE FORM HTML FOR NEWBIE


Hi… Welcome at my site…

Now… In here I want giving you knowledge javascript about “Manage Form”

Ok.. let’s do read it.

A. Manage CheckBox In Javascript

Define manage form is for correct what the chechbox was to fill (check) ?

Sintaks:
checkboxObject.checked = true|false

Example 1:

<html>
<head>We Are Knowledge<br>
<title>Tutorial Javascript - Array</title>
<script>
function a()
{
document.getElementById("x").checked = true
}
function b()
{
document.getElementById("x").checked = false
}
</script>
</head>
<body>
<form>
<input type = "checkbox" id = "x" /> <br>
<input type = "button" onClick = "a()"  value="Check Checkbox" />
<input type = "button" onClick = "b()"  value="Uncheck Checkbox" />
</form>
</body>
</html>


Example 2:
<html>
<head>We Are Knowledge<br>
<title>Tutorial Javascript - Array</title>
<script>
function a()
{
x = document.forms[0].x
y = ""
for (i = 0; i < x.length; ++i)
{
if (x[i].checked)
{
y = y + x[i].value + " "
}
}
document.getElementById("z").value = "You Ordered Coffee with " + y
}
</script>
</head>
<body>
<p>How whould you like your coffee ?</p>
<form>
<input type = "checkbox" name = "x" value = "cream"> With Cream <br />
<input type = "checkbox" name = "x" value = "sugar"> With Sugar <br />
<br />
<input type = "button" onClick = "a()" value = "send order"> <br /> <br />
<input type = "text" id = "z" size = "40">
</form>
</body>
</html>


B. Manage CheckBox In Javascript

Example 3:

<html>
<head>We Are Knowledge<br>
<title>Tutorial Javascript - Array</title>
<script>
function a(b)
{
document.getElementById("c").value = b;
}
</script>
</head>
<body>
Your Sex :
<br>
<input type = "radio" value ="man" name = "k" onClick = a(this.value)> MAN <br>
<input type = "radio" value ="woman" name = "k" onClick = a(this.value)> WOMAN <br>
<input type = "text" id = "c">
</body>
</html>


Example 4:

<html>
<head>We Are Knowledge<br>
<title>Tutorial Javascript - Array</title>
<script>
function a()
{
var
b = document.getElementById("b")
document.getElementById("c").value = b.options[b.selectedIndex].text
}
</script>
</head>
<body>
<form>
<select id = "b" onChange = "a()">
<option> Google Chrome</option>
<option> Mozzila Fire</option>
<option> Internet Explorer</option>
<option> Opera Mini</option>
<option> DMOZ</option>
</select>
<p> Your favorit browser is : <input type = "text" id = "c" size = "15"> </p>
</form>
</body>
</html>


Ok... just it...
I hope you understand with this all..
If you not underatand, please leave a comment..

Thanks For you.. Dont forget return...

Wednesday, July 11, 2012

TUTORIAL JAVASCRIPT - DINAMIC HTML FOR NEWBIE


Hello…. Visitors… Welcome Again at my page in We Are Knowledge. Now I want next of tutorial javascript about “DinamicH HTML”.

I want tutorial you about :
   A. Acces and Manipulation Object HTML
   B. Manipulation Style or CSS Object HTML

Ok. Let’s check it now.. have fun reading…

A. Acces and Manipulation Object HTML

For acces object HTML, we can using tools was present by javascript

Sintaks:
Document.getElementById(“id_object”)

Or we can too using this

Sintaks:
Document.getElementByName(“name_object”)

In sintaks of javascript “capital letter” and “lower case letter” sensitive..

Example 1:

<html>
<head>We Are Knowledge<br>
<title>Tutorial Javascript - Array</title>
</head>
<script type = "text/javascript">
function getElement()
{
var
a = document.getElementById("b")
alert("This Is Element " + a.tagName)
}
</script>
</head>
<body>
<h2 id="b" onclick="getElement()">
Click This For Showing My Name  Font Taq</h2>
</body>
</html>


To result :

Click This For Showing My Name  Font Taq
Note :
If you click “Click This For Showing My Name  Font Taq” want to appear alert “This Is Element H2”

InnerHTML
  • Method for manipulation Object HTML
  • For getting fill of text or HTML a object or HTML taq

Example 2:

<html>
<head>We Are Knowledge<br>
<title>Tutorial Javascript - Array</title>
</head>
<script type = "text/javascript">
function a()
{
a = document.getElementById("head").innerHTML;
alert("fill")
}
function b()
{
document.getElementById("head").innerHTML= "This Text Was Change";
}
</script>
</head>
<body>
<h2 id="head">Welcome User In My Page</h2>
<input type="button" onclick="a()" value="Look fill H2">
<input type="button" onclick="b()" value="Change fill H2">
</body>
</html>
To result :
If you click button “look fill H2” to appear “alert : fill”
If you click button “Change fill H2” text “Welcome User In My Page” became “This Text Was Change”
B. Manipulation Style or CSS Object HTML
Sintaks:
objectHTML.style.nameStyle = “set of style”
objectHTML.nameStyle = “set of Style”
or
document.getElementById(“nameid”).style.nameStyle = “set of style”
document.getElementById(“nameid”) nameStyle = “set of style”
example 3:
1. Change background color Table
<html>
<head>We Are Knowledge<br>
<title>Tutorial Javascript - Array</title>
</head>
<body>
<table border = "2" width ="400" bgcolor="green">
<tr>
<td onmouseover="this.bgColor='yellow'" onmouseout="this.bgColor='gray'">W-A-K</td>
</tr>
<tr>
<td onmouseover="this.bgColor='yellow'" onmouseout="this.bgColor='gray'">H-F-A-E</td>
</tr>
</body>
</html>


2. Change background color

<html>
<head>We Are Knowledge<br>
<title>Tutorial Javascript - Array</title>
<script>
function a()
{
document.bgColor = "pink";
}
</script>
</head>
<body>
<input type="button" onClick="a()" value="change">
</body>
</html>


Ok... just it... thanks for you...
if you have any quetions, please leave a comment

Thanks,,, se letter.

TUTORIAL JAVASCRIPT - DATE AND TIME FOR NEWBIE


Hello…. You now in my page… in We Are Knowledge….
Let’s read , my article..


A. Method Date and Time

In javascript we can too made date and time. For made date and time we must declarasion variable or object date or time it.

Sintaks:
Var mydate = new Date()

In this table to be found more method date and time for javascript

Method
Define
getDay()
For to appear date in a month
getDay()
To result name of day
getHours()
To result hour (start = 0, end = 23)
getMinutes()
To result minutes (start = 1 end = 60)
getSecond()
To result second (start = 1 end = 60)
getMonth
To result name of moon (start = 1 end = 12)
getYear()
To result year
getTime()
To result time more full

Example:

<html>
<head>We Are Knowledge<br>
<title>Tutorial Javascript - Array</title>
</head>
<body>
<script type = "text/javascript">
var
a = new Date()
b = a.getYear()
c = a.getMonth()
d = a.getDate()
document.write("Date for today: ")
document.write(d +"-"+c+"-"+ b)
</script>
</body>
</html>

To result :
Date for today : 07-06-2012


B. Javascript Timer

In javascript to be found too function “timer”, is seTimeout(), this avail to manage or setting timer for working a function or other code.

Sintaks:
setTimeout(“expression”, delaytime)

Expression can javascript code or a function
Define delay is every how millisecond a expression want execution

example:

<html>
<head>We Are Knowledge<br>
<title>Tutorial Javascript - Array</title>
</head>
<body>
<input type = "text" id="timer" name="text">
<input type = "button" name="knop" value="ClicK" onClick="count()">
<script type = "text/javascript">
var
c = 0
document.getElementById("timer").value= ""
function count()
{
document.getElementById("timer").value=c
c=c+1
setTimeout("count()", 1000)
}
</script>
</body>
</html>


C. Digital Clock

You can copy and paste thiscode in your application..

<html>
<head>We Are Knowledge<br>
<title>Tutorial Javascript - Array</title>
</head>
<body>
<form name="timer">
<input type ="text" size = "12" name="clock">
</form>
<script type = "text/javascript">
function show()
{
var
a = new Date()
b = a.getHours()
c = a.getMinutes()
d = a.getSeconds()
e = "AM"
if(b > 12)
{
e = "PM"
b = b - 12
}
if (b == 0)
b = 12
if (c <= 9)
c = "0" + c
if (d <= 9)
d = "0" + d
document.timer.clock.value = b + ":" + c + ":" + d + " " + e
seTimeout ("show()", 1000)
}
show()
</script>
</body>
</html>


Ok… just it thanks for you was reading my article . Don’t forget for reading my other article…

Ok.. see you again… in my other page

Tuesday, July 10, 2012

TUTORIAL JAVASCRIPT - ARRAY FOR NEWBIE


A. Define Array

Hi... Welcome in Mysite in "We ArE KnOwLeDGe"...
You know of array..? In javascript too present array operation. And Array isc likely mono variable or one variable with many element with same of type.

Example form of array:

Book[1]= “computer”
Book[2]= “economy”
Book[3]= “science”
Book[4]= “logic”
Book[5]= “Accountancy”

How To Made Array In Javascript ?
Fristly for made array we must declarasion variable array with

Sintak:

New array()
               1.       In made variable of array be more specification, like as :
               2.       Name variable must start from Letter character.
               3.       Not be space (if you will using space use underscore(_)
               4.       Not using special character


Example 1:

<html>
<head>We Are Knowledge<br>
<title>Tutorial Javascript - Array</title>
</head>
<body>
<script type = "text/javascript">
var
hardware = new Array()
hardware[0] = "VGA"
hardware[1] = "RAM"
hardware[2] = "HDD"
for (a=0;a<hardware.length;a++)
{
document.write(hardware[a] + "<br />")
}
</script>
</body>
</html>

To result :
VGA
RAM
HDD


Example2

<html>
<head>We Are Knowledge<br>
<title>Tutorial Javascript - Array</title>
</head>
<body>
<script type = "text/javascript">
var
hardware = new Array("VGA", "RAM", "HDD");
document.write(hardware[2])
</script>
</body>
</html>


Look on example 2 red color number “2” . Want to result “RAM”.
If you change ”1” or “3” to result is “VGA” or ”HDD”


B. Method Manipulation For Array

Properties
Define
Length
To result count element in array
concat
For fushion more than one array
Pop
For remove or delete last element array
Reverse
For requeue element in array
Shift
For delete first element in array
Short
For queue element of array


Sintaks Array:

arrayObject.concat(arrayX,  arrayX, …….,  arrayX,)


example:

<html>
<head>We Are Knowledge<br>
<title>Tutorial Javascript - Array</title>
</head>
<body>
<script type = "text/javascript">
var
a = new Array(3)
a[1] = "we"
a[2] = "are"
a[3] = "knowledge"
var
b = new Array(3)
b[1] = "have"
b[2] = "fun"
b[3] = "enjoy"
var
c = new Array(3)
c[1] = "lets"
c[2] = "site"
c[3] = "in my page"
document.write(a.concat(b,c))
</script>
</body>
</html>
And result :
“,we,are,knowledge,,have,fun,enjoy,,lets,site,in my page”


Ok... Just it...
Thanks for visitors...

TUTORIAL JAVASCRIPT - WINDOW OBJECT FOR NEWBIE


A. Opening Window In Javascript

For open window in javascript we can using method “open()”

Sintaks:
Window.open(url, name_window, configuration)

Example:
Window.open(“http://www.have-fun-and-enjoy.blogspot.com”, MyWindow”, width=”200”, height=”200”);

In window to be found 6 configuration :
1. Width
2. height
3. toolbar
4. menubar
5. scrollbar
6. resizable

For configuration we can setting, and this of define :

Configurations
Define
Value
Width
Setting Width of window
You can using “px”
Height
Setting Height of window
You can using “px”
Toolbar
For to appear browser toolbar
1 or 0
Menubar
For to appear browser menubar
1 or 0
Scrollbar
For to appear browser scroolbar
1 or 0
Resizeable
For change size window with direct
1 or 0


Example:

You can copy this code and paste in your application

<html>
<head>We Are Knowledge<br><br>
<title>Tutorial Window In javascript</title>
</head>
<body>
<script>
function open_WAK()
{
window.open("http:www.have-fun-and-enjoy.blogspot.com", "We Are Knowledge", height = "300", width = "400", toolbar = "1");
}
</script>
<input type = "button" onclick="open_WAK()" value="GO">
</body>
</html>

If done, you must save with “save as type = html”.
And for working program you just “double click of file”.


B. Reloading, Closing, Loading New Page, And Print.

For reloading window this method :
Window.location.reload()

And for closing window is with method:
Window.close:

For Loading New Page:

Or you can edit and this method:
<a href=” Window.location=www.have-fun-and-enjoy.blogspot.com”>W-A-K</a>

For printing web page:
Window.print()


C. Comunication Between Window

Define of communication between window is change, comunicastion, and manipulation object in window perent moment we open new window.

Sintaks window perent:
Window.opener

Example:
In this example you must made two file.. Is..
1. main file, for showing frist page, it want present for go to second file
2. second file, is part of main file.

A. Main file

<html>
<head>We Are Knowledge<br><br>
<title>Tutorial Window In javascript</title>
</head>
<script language="text/javascript">
function open_WAK()
{
var a = window.open("second", "newwindow", height = "300", width = "400");
}
</script>
</head>
<body>
<form name = x>
<input type= "button" value = "open" name="submit" onClick="open_WAK();">
<input type = "text" name="try" id="f">
</body>
</html>


B. Second File

<html>
<title><titlle>
<script language="text/javascript">
function h()
{
window.opener.document.getElementByid("f"). value = document.getElementByid("input"). value;
}
</script>
</head>
<body>
<form name= myform>
<input type="text" name="input" id ="input">
<input type="button" value="GO" onClick="h();">
</form>
</body>
</html>


Ok just for it… If you like this don’t forget bookmark this page..

And if you will question, please leaving comment.. And please wait. I want answer it.

Thanks visitor….