ÖRNEK JAVASCRIPT PROGRAM KODLARI

e-javascript'e giriş5:

 

 

 

Ve sonrasında ;

 

programımızın HTML kodu:

<?xml version = "1.0"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"

   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

 

<!-- Fig. 7.6: welcome5.html -->

<!-- Using Prompt Boxes      -->

 

<html xmlns = "http://www.w3.org/1999/xhtml">

   <head>

      <title>Using Prompt and Alert Boxes</title>

 

      <script type = "text/javascript">

                var name; // string entered by the user

 

                  name = window.prompt( "Please enter your name", "ahmet" );

 

         document.writeln( "<h1>Hello " + name +

            ", welcome to JavaScript programming!</h1>" );

             </script>

 

   </head>

     

   <body>

      <p>Click Refresh (or Reload) to run this script again.</p>

   </body>

</html>

f-2 sayıyı toplama işlemi:

 

_____________________________________________________________________________________________________________________________________________________

 

 

_____________________________________________________________________________________________________________________________________________________

1+4= toplam 5 dir.

 

g-javascript te tablo yapma:

 

programımızın HTML kodu:

<?xml version = "1.0"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"

   "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

 

<!-- Fig. 7.6: welcome5.html -->

<!-- Using Prompt Boxes      -->

 

<html xmlns = "http://www.w3.org/1999/xhtml">

   <head>

      <title>Using Prompt and Alert Boxes</title>

 

      <script type = "text/javascript">

                var name; // string entered by the user

 

                  name = window.prompt( "Please enter your name", "ahmet" );

 

         document.writeln( "<h1>Hello " + name +

            ", welcome to JavaScript programming!</h1>" );

             </script>

 

   </head>

     

   <bod<?xml version = "1.0"?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"

   "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

 

<!-- Fig. 9.6: Interest.html            -->

<!-- Using the for repetition statement -->

 

<html xmlns = "http://www.w3.org/1999/xhtml">

   <head>

      <title>Calculating Compound Interest</title>

 

      <script type = "text/javascript">

         <!--

         var amount, principal = 1000.0, rate = .05;

 

         document.writeln(

            "<table border = \"1\" width = \"100%\">" );

         document.writeln(

            "<caption>Calculating Compound Interest</caption>" );

         document.writeln(

            "<thead><tr><th align = \"left\">Year</th>" );

         document.writeln(

            "<th align = \"left\">Amount on deposit</th>" );

         document.writeln( "</tr></thead>" );

 

         for ( var year = 1; year <= 10; ++year ) {

            amount = principal * Math.pow( 1.0 + rate, year );

            document.writeln( "<tbody><tr><td>" + year +

               "</td><td>" + Math.round( amount * 100 ) / 100 +

               "</td></tr>" );

         }

 

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

         // -->

      </script>

 

   </head><body></body>

</html>y>

      <p>Click Refresh (or Reload) to run this script again.</p>

   </body>

</html>



ÜCRETSİZ KPSS VİDEO DERSLER, TESTLER BURADA TIKLAYINIZ


BENZER KONULARI SİTE İÇİNDE ARAYIN










  • SİTE İÇİ ARAMA
  • Kariyerdersleri.com
  • KATEGORİLER
  • HAKKIMIZDA
Mutlu olmayı yarına bırakmak, karşıya geçmek için nehrin durmasını beklemeye benzer ve bilirsin, o nehir asla durmaz.
KPSS MATEMATİK KPSS GEOMETRİ KPSS VATANDAŞLIK KPSS TÜRKÇE KPSS TARİH KPSS COĞRAFYA
İNGİLİZCE ALMANCA İTALYANCA KARİYER OYUN BİLGİSAYAR YAZILIM BİLGİSAYAR NETWORK
BİLGİSAYAR DONANIM BİLİŞİM TERİMLERİ CİLT VE CİLT BAKIMI HASTALIKLARIMIZ İNSAN VÜCUDU NEDİR