Rabu, 27 Mei 2009

Fungsi JS Script



<html>
<head><title>script</title></head>
<body><script laguage="javascript">
var a=12;
var b=4;
function pd2(b) {
var a=b*2;
return a; }
document.write("dua kali dari ",b," adalah ",pd2(b));
document.write("Nilai dari a adalah", a);
</script>

</body></html>


Masih pada script di atas, Pada baris ke - 7 Scriptnya diganti dari " var a=b*2; "
menjadi " a=b*2; "







<html>
<head><title>script</title></head>
<body><script language="javascript">
var a=12;
var b=4;
function pd2(b) {
a=b*2;
return a; }
document.write("dua kali dari ",b," adalah ",pd2(b));
document.write("Nilai dari a adalah", a);
</script>

</body></html>

Rabu, 13 Mei 2009

HORTATORY

Jo ngono!
akeh arek pusing i lowh!

Kuwi mau adalah upu sing diomongne karo Nay. . . .

Owalah!
mboh ez!

Bijim!Amu sing arep moco maneh menyang ngisor ea saiki tak kandani dilut ea
L' amu mengko marah ea jo marah nang mar'a ea . . .















Mboh argh!
aQ pengen turu dilut,
entenono ea . . .

JAWABAN SOAL "CALCULATOR"

soal-soal javascript calculator

1. Apa nama title skrip javascript tersebut ?

Jawab :<span>calculator smaneka</span>


2. ekstensi file Skrip tersebut disimpan dengan file ber-ekstensi jenis ?

Jawab : *htm

3. berapa jumlah variabel yang didefinisikan dalam file tersebut !

Jawab : 11

4. Berapa jumlah fungsi yang ada didalam skrip tersebut !

Jawab : 11

5. Tuliskan nama semua variabel skrip javascript tersebut ?

Jawab :

var minussign = ' - ';
var multiplysign = ' * ';
var dividesign = ' / ';
var decimalsign = ' . ';
var negativesign = ' -';
var leftbracket = ' (';
var rightbracket = ') ';
var rad = 3.141592654 / 180;
var base_10 = Math.LN10;
var base_2 = Math.LN10;

6. Tuliskan nama semua fungsi skrip tersebut ?

Jawab :
function calculate(arg) {
arg.expr.value = eval(arg.expr.value)
}

function enter(arg, string) {
arg.expr.value += string
}

function clear_display(arg) {
arg.expr.value = ' '
}

function calc_sqrt(form) {
form.expr.value = (Math.sqrt(form.expr.value))
}

function calc_sqr(form) {
form.expr.value = ((form.expr.value * 1) * (form.expr.value * 1))
}

function sin_form(form) {
form.expr.value = (Math.sin (form.expr.value * rad))
}

function cos_form(form) {
form.expr.value = (Math.cos (form.expr.value * rad))
}

function tan_form(form) {
form.expr.value = (Math.tan(form.expr.value * rad))
}

function inverse(form) {
form.expr.value = ( 1 / (form.expr.value))
}

function base10_log(form) {
form.expr.value = (Math.log(form.expr.value) / base_10)
}

function base2_log(form) {
form.expr.value = (Math.log(form.expr.value) / base_2)
}

7. Tuliskan skrip untuk membuat tampilan display pada skrip tersebut !

Jawab :

<tr>
<td colspan="5" width="100%"><input name="expr" size="35" action="calculate(this.form)" type="text"></td>
</tr>



8. Tuliskan skrip untuk membuat 1 tombol !

Jawab :
<tr><td width="20%"><input value=" sin " onclick="sin_form(this.form)" type="button"></td>

function sin_form(form) {
form.expr.value = (Math.sin (form.expr.value * rad))
}

9. Tuliskan fungsi jika tombol = ditekan oleh mouse !

Jawab : Onclick="sin_form(this.form)

10. Tuliskan skrip untuk membersihkan display !

Jawab :
<td colspan="2" width="40%"><input value=" C " onclick="clear_display(this.form)" type="button"></td>

function clear_display(arg) {
arg.expr.value = ' '
}

PROGRAM CALCULATOR




Sciptnya...

<html>

<head>
<title>JS - Calculator</title>

<script language="Javascript">
<!--
/* Variable */
var plussign = ' + ';
var minussign = ' - ';
var multiplysign = ' * ';
var dividesign = ' / ';
var decimalsign = ' . ';
var negativesign = ' -';
var leftbracket = ' (';
var rightbracket = ') ';
var rad = 3.141592654 / 180;
var base_10 = Math.LN10;
var base_2 = Math.LN10;

/* Yup...Mulai */
function calculate(arg) {
arg.expr.value = eval(arg.expr.value)
}

function enter(arg, string) {
arg.expr.value += string
}

function clear_display(arg) {
arg.expr.value = ' '
}

function calc_sqrt(form) {
form.expr.value = (Math.sqrt(form.expr.value))
}

function calc_sqr(form) {
form.expr.value = ((form.expr.value * 1) * (form.expr.value * 1))
}

function sin_form(form) {
form.expr.value = (Math.sin (form.expr.value * rad))
}

function cos_form(form) {
form.expr.value = (Math.cos (form.expr.value * rad))
}

function tan_form(form) {
form.expr.value = (Math.tan(form.expr.value * rad))
}

function inverse(form) {
form.expr.value = ( 1 / (form.expr.value))
}

function base10_log(form) {
form.expr.value = (Math.log(form.expr.value) / base_10)
}

function base2_log(form) {
form.expr.value = (Math.log(form.expr.value) / base_2)
}
//-->
</script>

</head>

<body>
<p align="center"><big><big>JavaScript - Calculator SMANEKA</big></big></p>
<form>
<!-- Rechner Beginn -->
<table border="0" width="100" bgcolor="#CCCCCC" align="center">
<tr>
<td width="100%" colspan="5"><input type="text" name="expr" size="35"
action="calculate(this.form)"></td>
</tr>
<tr>
<td width="20%"><input type="button" value=" sin " Onclick="sin_form(this.form)"></td>
<td width="20%"><input type="button" value=" cos " OnClick="cos_form(this.form)"></td>
<td width="20%"><input type="button" value=" tan " Onclick="tan_form(this.form)"></td>
<td width="20%"><input type="button" value="log10e" onClick="base10_log(this.form)"></td>
<td width="20%"><input type="button" value=" log2e " OnClick="base2_log(this.form)"></td>
</tr>
<tr>
<td width="20%"><input type="button" value=" Sqrt " Onclick="calc_sqrt(this.form)"></td>
<td width="20%"><input type="button" value=" Sqr " OnClick="calc_sqr(this.form)"></td>
<td width="20%"><input type="button" value=" ( " OnClick="enter(this.form,
leftbracket)"></td>
<td width="20%"><input type="button" value=" ) " OnClick="enter(this.form,
rightbracket)"></td>
<td width="20%"><input type="button" value=" 1 / X " OnClick="inverse(this.form)"></td>
</tr>
<tr>
<td width="20%"><input type="button" value=" 7 " onClick="enter(this.form, 7)"></td>
<td width="20%"><input type="button" value=" 8 " onClick="enter(this.form, 8)"></td>
<td width="20%"><input type="button" value=" 9 " onClick="enter(this.form, 9)"></td>
<td width="40%" colspan="2"><input type="button" value=" C " onClick="clear_display(this.form)"></td>
</tr>
<tr>
<td width="20%"><input type="button" value=" 4 " onClick="enter(this.form, 4)"></td>
<td width="20%"><input type="button" value=" 5 " onClick="enter(this.form, 5)"></td>
<td width="20%"><input type="button" value=" 6 " onClick="enter(this.form, 6)"></td>
<td width="20%"><input type="button" value=" * " onClick="enter(this.form,
multiplysign)"> </td>
<td width="20%"> <input type="button" value=" / " onClick="enter(this.form,
dividesign)"></td>
</tr>
<tr>
<td width="20%"><input type="button" value=" 1 " onclick="enter(this.form, 1)"></td>
<td width="20%"><input type="button" value=" 2 " onclick="enter(this.form, 2)"></td>
<td width="20%"><input type="button" value=" 3 " onclick="enter(this.form, 3)"></td>
<td width="20%"><input type="button" value=" + " onClick="enter(this.form,
plussign)"> </td>
<td width="20%"> <input type="button" value=" - " onClick="enter(this.form,
minussign)">
</td>
</tr>
<tr>
<td width="20%"><input type="button" value=" 0 " onClick="enter(this.form, 0)"></td>
<td width="20%"><input type="button" value=" . " onClick="enter(this.form,
decimalsign)"></td>
<td width="20%"><input type="button" value=" neg " onClick="enter(this.form,
negativesign)"></td>
<td width="40%" colspan="2"><input type="button" value=" = " onClick="calculate(this.form)"></td>
</tr>
</table>
<!-- Bisa... -->
</form>
</body>

</html>

Rabu, 15 April 2009

HAGHZ



<html>
<body>

<script language="JavaScript">

function chkuname()
{ uname=new String();
uname=document.regis.uname.value
if ( uname.length == 0 )
{ alert ("Enter a User Name"); }
else
{ chkupass() }}
function chkupass()
{ upass=new String();
upass=document.regis.upass.value
if (upass.length < 5) { alert ("Password Must be atleast 6 Chars"); }
else { chkname() }}
function chkname()
{ var ch=0; name=new String(); name=document.regis.name.value;
if (name.length==0)
alert ("Enter your Name")
else { u=0; for (i=0;i<name.length;i++)
{ if ((name.charCodeAt(i) >= 64 && name.charCodeAt(i) <= 90)||(name.charCodeAt(i) >= 97 && name.charCodeAt(i) <= 122)||(name.charCodeAt(i)==46)||(name.charCodeAt(i)==32))
{ }
else { u=u+1; } } if (u>0) {
alert ("Invalid Name"); }
else { chkdob() } } }
function chkdob(){ dob=new String();
dob=document.regis.dob.value
if (dob.length!=10)
alert ("Invalid Date")
else { if (dob.charAt(2)!="/" && dob.charAt(5)!="/")
alert ("Invalid Date Format")
else
tempstr=dob.split("/")
dd=tempstr[0]
mm=tempstr[1]
yy=tempstr[2]
if (dd>=1 && dd<=31 && mm>=1 && mm<=12 && yy>=1900 && yy<=2004 )
{ chkemail() } else alert ("Enter Valid date") }}
function chkemail()
{ mail=new String();
mail=document.regis.email.value

if (mail.length<1)
alert("Please enter e-mail address.");
else { at_pos=mail.indexOf("@")
dot_pos=mail.indexOf(".")
if(at_pos<1 || dot_pos<1)
alert("Missing '@' and '.' in email address.")
else
{ u=0; p=0; for(var i=0;i<mail.length;i++)
{ if ((mail.charCodeAt(i) >= 64 && mail.charCodeAt(i) <= 90)||(mail.charCodeAt(i) >= 97 && mail.charCodeAt(i) <= 122)||(mail.charCodeAt(i) >= 48 && mail.charCodeAt(i) <= 57)||(mail.charCodeAt(i)==95)||(mail.charCodeAt(i)==46))
{ if(mail.charAt(i)=="@") p=p+1 }
else { u=u+1 } }
if (p>1)
alert ("Email must have only one '@'")
if (u>0)
alert ("Special Characters are not allowed") } } }

</script>
<form name="regis">
User Name : <input type="text" name="uname" size="20">
<br>
Password : <input type="password" name="upass" size="20">
<br>
Name : <input type="text" name="name" size="20">
<br>
DOB (DD/MM/YYYY): <input type="text" name="dob" size="8">
<br>
Email : <input type="text" name="email" size="20">
<br>
<input type="button" value="Submit" onclick="chkuname()" name="sub">
</form>
</body>
</html>

GRAND FINAL MAS LAN MBAK SMANEKA 2009

Waduwh!
Megelno!
Padahal ilo aQ gag niat melu kono'an
Mung kanggo kelasQ cek'ne ra mbayar 500rb
Humph!
Lakokne mlebu 10besar(8 April 2009)
Yo ez lah tak pasrah ae

Truz wktu ndk karantina(12 April 2009) aQ dipasangne karo Arya
arek X3 tp mewakili pazki
tambah mengkeret ta aQ
secara...
areke ckep.putih.duwur.duwe pacar.akeh sing nge-fanz.bla bla bla
koyok2e aQ sing ngisin-isini areke
aQ gag pantez 1pasang karo areke
humph!

tp la arep piye maneh to
lawong kuwi uduk karepQ
wktu dipasangne kabeh finalis dikongkon merem
truz pas melek...
BLEBEB!

Rabu, 25 Maret 2009

WE WILL NOT GO DOWN

WE WILL NOT GO DOWN (Song for Gaza)
(Composed by Michael Heart)
Copyright 2009


A blinding flash of white light
Lit up the sky over Gaza tonight
People running for cover
Not knowing whether they’re dead or alive

They came with their tanks and their planes
With ravaging fiery flames
And nothing remains
Just a voice rising up in the smoky haze

We will not go down
In the night, without a fight
You can burn up our mosques and our homes and our schools
But our spirit will never die
We will not go down
In Gaza tonight

Women and children alike
Murdered and massacred night after night
While the so-called leaders of countries afar
Debated on who’s wrong or right

But their powerless words were in vain
And the bombs fell down like acid rain
But through the tears and the blood and the pain
You can still hear that voice through the smoky haze

We will not go down
In the night, without a fight
You can burn up our mosques and our homes and our schools
But our spirit will never die
We will not go down
In Gaza tonight