bugün

javascript

web sayfalarını hareketlendiren kullanıcı dostu arayüzler oluşturmamızı sağlayan açık kaynak kodlu programlama dilidir. html kodu içine embed edilir. örneğin faktoriyel hesaplayan fonksiyon kodu;

<?xml version = "1.0" encoding = "utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtm...html1-strict.dtd">;


<html xmlns = "http://www.w3.org/1999/xhtml">;
<head>
<title>Recursive Factorial Function</title>
<script type = "text/javascript">
<!--
document.writeln( "<h1>Factorials )</h1>" );
document.writeln( "<table>" );

for ( var i = 0; i <= 1000; i++ )
document.writeln( "<tr><td>" + i + "!</td><td>" +
factorial( i ) + "</td></tr>" );

document.writeln( "</table>" );

// Recursive definition of function factorial
function factorial( number )
{
if ( number <= 1 ) // base case
return 1;
else
return number * factorial( number - 1 );
} // end function factorial
// -->
</script>
</head><body bgcolor = "orange"></body>
</html>