Docstoc

كتاب تعليم لغة جافا سكربت

Document Sample
كتاب تعليم لغة جافا سكربت Powered By Docstoc
					                                                      -:

         () *) + !          # ,- .,/) 0 1 2           %&&'           ! " #$
                                                                    Live Script

                   <= >?@          AB C    D    E     F?      * G    " +,/G

                                                      -:      , * @H *,G

                                                    ! G I            J,- 0? K

                                                                    <SCRIPT>

                                                                           --!>



                                                                         <--//

                                                                <SCRIPT/>

B      #G) # !    <SCRIPT> U V         +K *,G       *) ! 0 *W X     YB
                                                    <SCRIPT/> # / * Z[

      <--//   --!> \\ 0 ] +) 0 U     ) /             !, E F?         I<F       G)

                                                     -: )UAG * F ^ - G

    !HAb K IV I_B `     #WK Ya? , ` ?<F         - !G *              !V @G<
                                                                    Ya?B Ic

                                   U V * a?          K )d !          e     G

                                                                      -: # _B

                                                                    <SCRIPT>

                                                                           --!>

                  l("* BX          jA " ) GHB !            X#       XV ")alert

                                                                         <--//

                                                                <SCRIPT/>
      *          UV `   #WK m?          Ya? , `K )d H- nH            U# `G G1 H-
                                                                          *+   G

          *G) # !      nH *)        !     VF?p     B      n @HG " BX- o

 *) # !        #B qG     e ) nH           < ! *r?sH        *,t E F?p o
                                                                   *, p C

                                                                            -: *W XB

  _       !     B qG    ?     _B JAVA       - (,GqK java                    p *u !

              alert * F ` e    G    )     D +1 m              #G+G1 alert .

                "s, G { G          | EK d?B      DUV /*    */        // * Z       H-

                                                                        <SCRIPT>

                                                                                 --!>

                                                       hhhhhhhhhhhhhhh*/
                                                                  hhhhhh
                                                               /*hhhhhhh

                                                                 l("alert("7azm

                                                              hhhhhhhhhhhh//

                                                                               <--//

                                                                      <SCRIPT/>


                  •s // YcK         /* !#GHK */ \      +K 0          "s, G o

                                                              -: *      ]    "    ,

                                                   p *u       B ^j G)       ^jp !V

  break - do - function - null - typeof - case - else - if - return - var -
                                                       continue - export

import - switch - void - default - false - in - this - while - delete - for
                                                       - new - true - with

                                                                        -: "     uG
        *B qG       Ip       B"   + 0jqK *            CU 0              * _          +G K

                                  p     qG            D•             G) ŽB        C !

*r       qG    K`       B    !H K m A        +) 0             uG , `G   K H-
                                                           uG       ! * GAG

                                                           a     +)          uG

                                             *A At "                 uGB ^             _B

                                                                                    JaVa

                                                                                  Ja_VA

                                                                               java123

                                         -: *“r < "                  uGB ^             _B

                                                                                  hhhh”

                                                                                  m88••

                "var" *       ]   * ,            qG            ) p     uGB ^             a

                                                                         <SCRIPT>

                                                                                     --!>

                                                 l"var message="first java

                                                               l("alert("message

                                                                                    <--//

                                                                        <SCRIPT/>


                                                                      -: "        + ™?

              * G       * , - ! *+ t *u * _                                  p *u     +G K

 true    1 ^?       *       A I   X          a         )jqK ?sK #K                uGB 0
                                                                                    false

                                                                         <SCRIPT>

                                                                                     --!>
                                                                                  var a=0.06

                                                  l"var b = "java script in easy steps

                                                                                  lvar c false

                      l(alert(typeof a + "\n" + typeof b + "\n" +typeof c

                                                                                          <--//

                                                                                <SCRIPT/>

* FJ       #          G)       *         *     a"Ÿ"       uGB ^           ?s) .              _
                                                                                          ()alert

                    # *t q "                 + ™?H *      G ¡          typeof        qG       G)

  /        ! *      aI         *t q " p q               ¡          ?s) "+n/+" F?            ?s)
                                                                      )UAG Y B !             ) p

                                                            -: Escape Sequences ?#EB

                0     n ! m                  C "/" *,]        *r         *BX- .+          K B H-

               K¤          -       ?“    B       B ™?     B *BX         DUV Y+G) CU m A

                                             pe 1 K      B ^jp m A         UV + G)         F AB

                                                                          mU -----------b/

                                                                   m        <F -----------f/

                                                                       ) p /    -----------n/

                                                                   ™?p *BX------------r/

                                                                   *     p *BX-----------t/

       *       A *,    ,           ^ #G J,-         K     DF EB         +Ga *BX----------'/

           *    A *,       ,            *) # J          K *p jB         +Ga *BX----------"/

                                                          D           * E,< *r b--------//

 ^ # 0 F nH *,                 ,        I< F     # BF .) r        -     #HB DF EG        )
                                                                                 *    E nH
                                                                                      _B

                                                l(""\alert("aaaaa\"a9aaa

                                                                            -:

                                            *u * B       "                   B !V

                                                     }()function call_alert

                                 l("alert("my first java script function

                                                                                      {

!G   {}       ?a         B© j      ()      ?s -?+GB           0? ) 0 e )
                                           DU EHK F        F?  J,- C?GAK

                                 call_alert *              .                 _        !

                                    alert *       ^- G          G) m?            F?

 HTML ! <BODY> j B G *BX                   *t q "onload" *                            )

                                        <"()BODY ONLOAD="call_alert>


                                                               -:                •]

          *        I    X   "       J,- I G      )   uGB            1       qG    ) str

                                                 }(function call_alert(str

                                                                        l(alert(str

                                                                                      {



                       <"('BODY ONLOAD="call_alert('passed value>


                                                           -: F         G

                                                }(function call_alert(num

                                l(var new_number=make_double(num

                                   l(alert("the value is"+new_number
                                                          {

                    }(function make_double(num

                    lvar double_num=num+num

                              lreturn double_num

                                                          {




                <"(BODY ONLOAD="call_alert(4>


                          -: *t q "        uG        ²/

                                  var stored_num

                        }(function call_alert(num

                               lstored_num=num

                                   l()make_triple

                l(alert("the value is"+stored_num

                                                          {

                         }()function make_triple

lstored_num=stored_num+stored_num+stored_num

                                                          {




                <"(BODY ONLOAD="call_alert(5>

                               -: DF   G        •]    ?

                                           lvar a,b,c

               }(function call_alert(str1.str2,str3
                                                               la=str1

                                                              l:b=str2

                                                               lc=str3

                                                  l(alert(a+b+c

                                                                        {

•]   * X J,- C?GAK !G *             ()    G           _        UV ?s)

     a ¤X J,- C?GA) 0 e ) # ^ - G                     C 0          `U

            *   J m           B " -?          B ¤X IsH               ?s)


                *   *          *              *            *


                        A                                      B H #G

                         -: !K                - 0? K d 0

                        * @H *,G              * G1 *s) r ***

                                   )UAG * F ^ - G                   ***

                                    *                     "    ,    ***

                                                      "       uG    ***

                                              "       + ™ ? ***

                        Escape Sequences ?#EB ***

                                                                    ***

                                                          •]        ***

                                         DF       G                 ***

                               uG        >q                         ***

                                          •]          ? F          K ***

       (:               + -         ^b0               ! _
                                  -: * Z )       Iu      G "XB B

    µ +     #c + *    A I         X       •      Y       <==== +

                                                       ¶ r <=== -

                                                  · c <=== *

                                                 *      s <=== /

                                      *       s !a <=== %

                              *    s Y            DF )d <=== ++

                          *    s µE<              > s <=== --

D ) AK   K CU    s    *   s µE<              Y       0 B?s) --   ++

                     a=b*c-d%e/f;                \\ this is unclear

                      a(b*c)-((d%e)/f); \\this is clear

                                          lvar addnum=20+30

                              l"var addstr ="love"+"7azm

                                      lvar sub=35.75-28.25

                                                     lvar mul=8*50

                                                 lvar mod=65%2

                                      lvar inc=5;inc=++inc

                                      lvar dec=5;dec=--dec

                l"var result="Addunm is"+addnum+"\n

                     l"result +="Addstr is"+addstr+"\n

                           l"result +="Sub is"+sub+"\n

                          l"result +="Mod is"+mod+"\n

                           l"result +="Mul is"+mul+"\n

                              l"result +="Inc is"+inc+"\n
                                                l"result +="Dec is"+dec+"\n

                                                                  l(alert(result


                                                  -: * s/H     Iu    G "XB B

                                                       Logical AND <=== &&

                                                         Logical OR <=== ||

                                                         Logical NOT <=== !

   a J,- C?GAK !G "XB                YB * s/H         Iu      G "XB B    qG K
                                                              false true *s s

                           false         true J       ?AGK 0 #H     ) !G        s

 *At    + Ÿ true *     s ¡               ?s)      G   a *At    B .sAG          ?sK &
                                                                     G     s     G,1

                       false *       a¡           ?s) & I u    G IB B 0

                  G    s       B *   a C *At           + Ÿ true ¡          ?s) ||

 D /<   IB      *A@ DF A             *    s nA             +G< ŽK ¡             ?s) !

                                                                           -:       _B

J,- C?GA) JaVa!   uG       0    true *         a J,- C?GA) JaVa     uG   01?
                                                                     false * a

I1 ! *       1¼) UV !=JaVa ! G I                      #+G K 0 " s +/G Ic
                                                          * s      uK G) D?/<

                                                             var a=true,b=false

                  var test1=(a&&a); //test both operands for true

                                                             l(var test2=(a&&b

                                                             l(var test3=(b&&b

                  var test4=(a||b); //test either operand for true

                                                              l(var test5=(a||b

                                                              l(var test6=(b||b
  var test7=!a;var test8=!b; //invert values

                        "var result="AND\n

lresult +="1:"+test1+"2:"+test2+"3:"+test3

                     l"result +="\n\nOR\n

lresult +="4:"+test4+"5:"+test5+"6:"+test6

    lresult +="\n\n!\n7:"+test7+"8:"+test8

                                 l(alert(result

         -:   s      G >q Iu         G IB B

                         (=) I u     G IB B

                                     a=b    _B

                        a=b *)          *   s

                        (+=) I u     G IB B

                                    a+=b    _B

                     a=a+b *)           *   s

                         (-=) I u    G IB B

                                    a-=b    _B

                      a=a-b *)          *   s

                        (*=) I u     G IB B

                                    a*=b    _B

                      a=a*b *)          *   s

                        (/=) I u     G IB B

                                    a/=b    _B

                      a=a/b *)          *   s

                       (%=) I u      G IB B
                                                 a%=b     _B

                                  a=a%b *)            *   s

                                                    -=:   _B

var a="JavaScript", b="code"; //assign string values

        a+=b;     //concatenate strings and assign to

             a var c=8,d=4; //assign integer values

          c+=d; //add numbers and assign result to

           c var e=7.5,f=2.25; //assign float values

       e-=f; //subtract f from e and assign result to

            e var g=8,h=4; //assign integer values

      g*=h; //multiply numbers and assign result to

                g var i=8,j=4; //assign integer values

            i/=j; //divide i by j and assign result to

              i var k=8,I=4; //assign integer values

         k%=I; //divide K by I and assign result to

                  -=: *   s       *t q I u        G "XB B

                                        C        G D H B ==

                                   C        G      - D H B =!

                                                B +1 D H B >

                                                B Ia D H B <

                              C     )       B +1 D H B =>

                              C     )       B Ia D H B =<

                                                    -=:   _B

     l("var teststrings1=("JavaScript"=="JavaScript
                     l("var teststrings2=("JavaScript"=="javaScript

                                        l(var teststrings1=(1.78==1.78

                                         l(var teststrings2=(1.78!=1.78

                                             l(var teststrings1=(15<15

                                             l(var teststrings2=(15>15


                                                                  -=: *W XB

                  _B     ?         - (,Gq) IG+   " ,             *     s         H-

                  l("var teststrings1=("JavaScript"=="JavaScript

                                           s /GB         # *A At D +- DUV

                     l("var teststrings2=("JavaScript"=="javaScript

 +1 JK J       ! (J) !p m              mXG< ! e+              *“r < D +- DUV
                                                               ut * _ !

                                            -=: !r             Iu    G IB B

                                          IcE        *    s    IB B ?V +G )

true *    G ¡ -   V /<         #GAt " +     *F           !r b       +G<     ?s)
                                                                           false

                             +G<   *   GH s+r    H        D +- U EHG       ?s)

                                             -=: ?V DU# > q e 1 G

                     ltest expression)?if true do this: if false do this)

         B e) ¿E@G     *t q *u,           F I u K B IB               UV `H )
                                             ) AK ŽB .                 ) CU

                                                                       ¿E@G

           var browser=browserID;//Internet Explore or Netscape

                  l()browser=="IE")?greetIEuser():greetNNuser)
         ************************************************

        WG   ) p     F!       1 s,     ^b0      ! _              !#GH) HV J


                                      *HB      EG   K      ?p       2 _

                                                         -=: * r          if    +-

                                                                      -: #G+ 1 K

                   lif(test expression)statement to execulte when true

                                                                           /    _B

                                                                 var msg,num

                                                                         lnum=7

                                                               }(if(num%2!=0

                                            l".msg="This is an odd number

                                                                    l(alert(msg

                                                                                 {

*   s        1 Ÿ   ) AG (%) *        s !a IB B +G< G) .     _
                                             num uG   ! DF?p?

                                                          À J,- *         s I+sK


             qG    CF     a    0     B 1 G, .           e1 G        qG         ***

                                                                (num(%2==1

                                                if \\ > q       B    ¿Z?)       _B


                                                         lvar username=null

                                                        }(if(username==null

                    l(""Á"username=prompt("please Enter Your Name

                          l(if(username!="")alert("welcom"+username
                                                                            {


`   ?<F `HB e,/) Y B `        #W) m?         .        _  UEHK B H-
                                   e          K D +- ` eG ) ` Ÿ

                                              *G,<F         CU



                                        -=: if-else *       B + "       +

                                      !r               sG    c) m           )

                         lif(test expression)do this;else do this

                 else * ,1 I+a *r?sHB *,t            F?p     B      o

                                             lvar num=2,bool=false

          l(if(num==1&&bool==1)alert("TEST1 bool:"+bool

                                                                        else

          l(if(num==2&&bool==1)alert("TEST2 bool:"+bool

                                                                        else

          l(if(num==2&&bool==0)alert("TEST3 bool:"+bool

                                                                        else

          l(if(num==3&&bool==0)alert("TEST4 bool:"+bool



                                           -=: switch {      B +        +

* KH *   s YB   ]XG)    ?H-      sK    Â       *At      B .sAG           ?sK

                0 ?H     ) AK ! case *           ]    * ,          qG       K

    !Z G        F?     ) AK ! default *          ]    * ,          qG       K

                     break * ,        0 ?H    F?1 *) # 0? K 0 e )

                                                            lvar num=2
                                                        }(switch(num

                     lcase 1:alert("This is case 1 code");break

                     lcase 2:alert("This is case 2 code");break

                     lcase 3:alert("This is case 3 code");break

                          l("default:alert("This is default code

                                                                          {

                                                    -=: for         G    W

                                                                    *G+ 1 K

                      lfor(initializer,test,increment)statement

F -·   A >q F        , *) + *       a ) AK !        initializer       qG )
                                                                    G " B

  "i" * ,- .,/) *    1¡ u      U#        uG        qG   ) a             !

       (a?GK *“r < 0? K B H-         G    ) *A At             0? K B H-

                                                    F         )j)       F I1

                                                         lvar a=0,b=0

                                               }(++for(var i=0; i<5; i

                                                        la+=10;b+=5

                                                                          {

                    l(alert("FOR LOOP\n\n A is"+a+"...B is"+b

                                                -=: For-In          G    W

                                                        l""=var i=0;a

                                              }(or(property in window

                                                   l"..."+a+=property

                                                                          {
                                                   l(alert(a

                                  -=: while            G           W

              /< *   s ¡ - 0 I@) 0 J               +G<             G)

                                         /*/*/*/ )UAK

 ¿E@G         B K nH ²XÄ !] # X              G         W        ?s)

                                     lvar i=0,num=50

                                            }(while(i<15

                                                       l--num

                                                           l++i

                                                                   {

l(alert("LOOP stopped at" +i+ "\nnum is now" +num

                           -=: Do-While                G           W

          G     W J,-    K do *     ]    * ,               qG          K

          *“r < *    GH ¿+@K JG         G          F       G       K

                                     lvar i=0,num=50

                                                               }do

                                                       l--num

                                                           l++i

                                            l(while(i<1{

l(alert("LOOP stopped at" +i+ "\nnum is now" +num

                           -=: Break *           B +           +

                                                   lvar i=0

                                             }(while(i<6

                                        lif(i==3) break
                                                                   l++i

                                                                        {

                        l(alert("BREAK\n\nLoop stopped at" +i

                                   -=: CONTINUE *         B +       +

                                   *     A        ^# !          qG       K

                                                      l""=var i=0,str

                                                        }(while(i<5

                                                                   l++i

                                                lif(i==3)continue

                                                         l""+str +=i

                                                                        {

    l(alert("CONTINUE\n\nLoop stopped:" +i+ "\n\nSeries:"+str


                                         -=: With *    B +      qG

]         * Z J *p A 0 F       ]        n] @< J D bX            qG K
                                               *tq               I+a

                                                             -=:        _B

* t q J,- C?GA) CU document         ]     J,- e)? " AEt C?GAK
                                          ©Ÿ H J D bX forms

                                          e)? *AEt ! DF?p?

                      "document.forms.order.user.value="7azm

                        "document.forms.order.city.value="ksa


                                                             -=:        _B

                                   }(with(document.forms.order

                                             l"user.value= "7azm
                                                                         l"city.value= "ksa

                                                                                              {


 *****************************************************

                                                      - J,-                      H) 0 JH K

                                                          *, t?K ! *s                 a 0?1

                                                                               !K AK ?,+sK

                                                  *K 1               *            ,- X

*+A)    1)            Hs   *            e+                 !         < G J,-          p(
                                                                                      JZ )

            F %” VF - !G                       FI                        FD    - H ,- !s

                                                          -=: ?           Y                   +



******************************************************
                                                  ****

                                                                    -=: " ?E@           ^

new *   ]     * ,              qG       K * ?E@B * J,-               uG       YB IB G         G)

                                    ()Array ^J        H        YB                 p *u !

               ) AG * ?E@               ! "       +       B DF       GB ™ ?      ) AK        )

                                   E@    +) CU            #E         a        * ?E@

                                                                     ()var a=new Array

                                                                              l"a[0]="First

                                                                     l"a[1]="JavaScript

                                                                              l"a[2]="Array

               +G )            a        E@    @H          B               #E 0 o X 0

                                   2 _       @H       +G )       H        a    ! _      @H
                             l("var a=new Array("21st","22nd","23rd

                              l("Ávar b=new Array("Jan,","Feb,","Mar

                            l("var c=new Array("2001","2002","2003

                                                  l([alert(a[0]+b[1]+c[3

                     UV I         #    ·?G B      )UAG * F `      #WK m?


                                                           st Feb 2003À%

        eG K .         _     ÉE ST I+a        )   -        a 0 D +G       YB

                                          ******* •s * +HG *******

             IA   UV © < Ÿ        "      B *s) /           K( 1       -0

    @H      U< 0Ÿ      Et    a U< ) a m A J           W    p•     ·?
                                                            stÀ% ?V *HB

           Feb ?V *HB ! _         @H     U< 0Ÿ             a U< ) b m A

           ÀÊÊË ?V *HB 2 _        @H     U< 0Ÿ        H    a U< ) c m A


                                             ******* * +HG J#G *****

                                                      -=: * ?E@          t H-

                            @H-        * ?E@       ! *     a I1 J,- .,/)

* ?E@     # ,- I G    K !G    tH       F - ) AG       qG   K length { t <

    * ?E@         ]1!        tH       F -J         K array.length * t q

                                                                   ///     _B

                                                      l()var a=new Array

                                                            l"a[0]="Much

                                                           l""a[1]="More

                                                      l"a[2]="JavaScript
                                               lvar arraysize=a.length

          (lalert(a[0]+a[1]+a[2]+"\nNo.of elements is"+arraysize


             -=: * ?E@     t H- J        a    <F        G        W       qG

                             l"var str="FILL ELEMENTS LOOP\n\n

                                                   l()var arr=new Array

                                                }(++for (var i=0;i<8;i

                                         l"arr[i]="Number is"+i+"\n

                                                             l[str +=arr[i

                                                                              {

                                                                 l(alert(str


                                             -=: t H        B )j         * Z

             array.length * t q     qG       !, E           #E       a * Z

*   a J,- C?GA)   CU ! G    @H , ” ¿ A@            a         K ¿Z?)       _
                                                             a * ?E       !


                                              l(var a=new Array(1,2,3

                                    a[a.length]=4 //a.length is 3

                                              l(var b=new Array(5,6,7

                                      }(++for(var i=0;i<b.length;i

                                                       [a[a.length]=b[i

                                                                              {

                                                       l(()alert(a.concat


                                  -=: t H       *t q m               I    X
   B *-?   B J * ?E@       t H- Y   p I)?AG     ?sK ()array.join
                                               * A I X

*Z G   *,t E, I)   It     ) AG C    G<   •     ? I+sK 0        )

                                             l()var a=new Array

                                                     l"a[0]="It

                                                  l"a[1]="isn\'t

                                                 l"a[2]="rocket

                                               l"-a[3]="science

                                                   l"a[4]="it\'s

                                                   l"a[5]="just

                                                  l"a[6]="Java

                                               l(("")alert(a.join

                               -=: @H      >q eK G É -

                                * @H *,G        B ^jp UV 0 1 ?

       l("var imgs=new Array("img1.gif","img2.gif","img3.gif

              img3.gif-img2.gif-img1.gif ?V HV ¿ A@ ŽK H

                             img1.gif-img2.gif-img3.gif É

                                                          //   _B


       l("var imgs=new Array("img1.gif","img2.gif","img3.gif

                                                 lvar rev=false

       ....slideshow routine is displaying the final image so//

                                                     lrev = true

                                                 }(if(rev==true

                                                l()imgs.reverse
             rev=false;}   //remember to reset the test variable

                                             l("-"alert(imgs.join


                                           -=: * - E " ?E@

 *    A * ?E@      B D ) p * ?E@B I - !        qG   K ()array.slice

                                                           //     _B

                               l(var a=new Array(1,2,3,4,5,6,7,8

                                              l(var b=a.slcie(2,5

                                             l(var c=a.slice(1,-1

                                                l(var d=a.slice(3


                                        -=: * ?E@      t H- e K K

  *    A I   X      tH     *t q    s eK G      qG   K ()array.sort
                                                    *)     *s) /

                                                           //     _B

                      l(var integers=new Array(3,8,1,9,7,5,4,2,6

      l(integers.sort(); var floats=new Array(0.5,0.125,0.57,0.25

l("floats.sort(); var strings=new Array("7azm","mohammad","ali

                                                    l()strings.sort

                                                l"var str="SORT

                 l"-"str +="\n\nIntegers array is"+integers.join

                      l"-"str +="\n\nFloats array is"+floats.join

                    l"-"str +="\n\nStrings array is"+strings.join

                                                        l(alert(str


       ?@    *t q I      AG " ,       # G ! * ?E@            qG
                                               -=: #Z        G
                                                              <SCRIPT>

                                                                     --!>

           l("var pics=new Array("pic1.gif","pic2.gif","pic3.gif

                                          l()var preload=new Array

                                  }(++for(var i=0;i<pics.length;i

                                           l()preload[i]=new Image

                                                 [preload[i].src=pics[i

                                                                          {

                                                                    <--//

                                                           <SCRIPT/>


          DjV p 0? K JG     ?t ¤X I         AK     qG     .           _

                 ?@ *V ! GG       ¡          >q           G Iu       K H-

           ?@ (,        > q 0 ?H      J,- C?GAK J              * ?E@


                                   *K 1            *           ,- X

                                                    ÉB q                  +

                        ********************************



                         *******************************

           -=:     qG       Bd YB e        HG)     Ì) G        a?    ) AK

B            p *u !       #B qG       G)     )U, Ì) G        a? F AG)
                                                          > q ŽB +

                   (c        WH !          )F?p?        )?sG    *-

    e )   WH *-         *t q " B?,         J,-      ?@A `H          )!
                                              date    ]1^                   nH      ?s) 0

                                                             l()var now=new Date

                                                                             l(alert(now

                        (-: #        W    V ?#$ * E 1 ¿Z?K D ?t .                       m?


                                                     -=: Ì) G         *t q " B?,

          +          B *)   *,   ,       B*   s1 ?      ¡         ?sK date.getDay
                                                               Et * s Saturday

                                                     friday *              Í*      s JG

                                                                                U V !H )

                                                            Et *          s U< )        +

                                                                      *    s U< )

                                                              H *          s U< )           H

                                                          ¤X *            s U< )    ^ X_

                                                       *          *       s U< )    ^

                                                  *         < *       s U< )       É        q

                                                        F       *         s U< )    *


              B *)     *,   ,    B*      s1   #       ¡           ?sK date.getMonth

                                                            Et *          s U< K january

                                                        %% *      s U< K december

    l("var days=new Array("sat","sun","mon","tue","wed","thu","fri

                                                     var mons=new
Array("jan","feb","mar","apr","may","jun","jul","aug","sep","oct","n
                                                         l("ov","dec

                                                             l()var now=new Date

                                                            l()var yy=now.getYear
                    l[var mm=now.getMonth();mm=mons[mm

                                              l()var dd=now.getDate

                              l[var dy=now.getDay(); dy=days[dy

                                l(alert(dy+""+dd+""+mm+""+yy

I1 o   ` U ·?,,/   UEH)       * @H *G,    ! •            /< C *W XB
                                    m     A o          *G G   a  ?a

                                               * ]XB     ^ /<    B *+G


                                        -=:     a?     *t q " B?,

                                                l()var now=new Date

                                             l()var hh=now.getHours

                                         l()var mn=now.getMinutes

                                         l()var ss=now.getSeconds

                                   l()var ms=now.getMilliseconds

                                              l"var hi="Good Morning

                                  l"if(hh>11)hi="Good Afternoon

                                      l"if(hh>17)hi="Good Evening

                                                       l"var tim=hi+"\n

                                          l"tim+="Hours:"+hh+"\n

                                      l"tim+="Minutes:"+mn+"\n

                                       l"tim+="Seconds:"+ss+"\n

                                                             l(alert(tim


                                                     -=: ! A       a?G

Ì) G   *t q " H]     B    H       *    s ,      qG     K ()date.getTime
                                                       D )    * H     B
                                      l()var start = new Date

                                  l()var msec1=start.getTime

                                                  lvar num=0

                                 }(++for(var i=0;i<250000;i

                                                     l++num

                                                               {

                                         l()var stop=new Date

                                  l()var msec2=stop.getTime

                               lvar diff=(msec2-msec1)/1000

                       l("alert("Time elapsed:"+diff+"seconds



                                                    *****
B    G " B F - I ,sG    a netscape `AE@GB 0 1 Ÿ // *W XB
                                          'ÊÊÊ J À'ÊÊÊÊ
                                                    *****


                          -=: Universal Time Clock J,- m   G

    ÏGH) p •<   a?K !          a?G * _    Universal Time +G )


                                         l()var now=new Date

                                     l()var hh=now.getHours

                                  l()var mn=now.getMinutes

                                      if(mn<=9)mn="0"+mn

                                   l()var ss=now.getSeconds

                             l()var utc_hh=now.getUTCHours

        l"var wet="athens time:"+hh+":"+mn+":"+ss+"\n\n
              lvar utc="Universal time:"+utc_hh+":"+mn+":"+ss

                                                       l(alert(wet+utc

                  !       · u, !,A           a?G ^ - G          _       ?s)

                                                                    ***
a   - D +- 0? G   *   s 0   D    -    B Ia .] a             1 Ÿ / *W XB


                      #     Et * Z      ?s      * B + n 0           ` U
                                                                     ***

                                                   -=: * HBj *s/H

       #   ! GH) !G * HBj *s/H         F AK 0                p *u,        )
                                                       X<    B   qG

                                          date.getTimeOffest * HsG

                                                l()var now=new Date

                             l()var offset=now.getTimezoneOffset

                                                               lvar msg

                                                       }(switch(offset

                                lcase 240:msg="East Coast";break

                                     lcase 300:msg="Central";break

                                lcase 360:msg="Mountain";break

                                     lcase 420:msg="Pacific";break

                                                   l"default:msg="all

                                                                         {

                            l(".alert("Welcome to"+msg+"visitors



                                 -=:    a?      Ì) G    ) AG        a   <F

                                                l()var now=new Date
                    l"var orig="Original:\n"+now.toString()+"\n\n

                                                          l(now.setDate(21

                                                          l(now.setMonth(1

                                                         l(now.setHours(12

                                                        l(now.setMinutes(30

                                                     l(now.setSeconds(15

                                                   l(now.setFullYear(2005

                                             lvar mod="Modified:\n"+now

                                                           l(alert(orig+mod



                                                                           ****
                   *         *,    ,    - D +- *     a¡             ?sK toString
                                                                           ****

                                  -=: date    ]   *t q      s        )jqK ·?,

#,)?AG   ?sK *      I    X        J     s I)?AG     ?sK date.toGMTString
                                                   GMT * HBj *s/H    J


                                                     l()var now=new Date

                 l"VAR jpn="Tokyo time:\n"+now.toString()+"\n\n

                       l()VAR gmt="UTC time:\n"+now.toGMTString

                                                            l(alert(jpn+gmt



                                                  -=:     WH {-            qG

                  ()setTimeout * HsK YB #B qG                   )     WH *-

    ?    Y B ¡ - Ip      B * HsK        qG        ?sK ()window.setTimeout

                                       ! ?        - J I@K D G !           )UAG
                                            lvar num=0

                                    }()function annoy

                                                l++num

          l(alert("This is 10-Second Message No:"+num

                l(window.setTimeout("annoy()",10000

                                                            {

                                                l()annoy



                                 -=: !HBj       a¼     ^u


                                       lvar num=0,tim

                                    }()function advise

                                                l++num

                                         }(if(num==3

l(alert("Ok-Itold you twice"); window.clearTimeout(tim

                                                     }else{

          l(alert("This is 10-Second Message No:"+num

          {l(tim=window.setTimeout("advise()",10000

                                                            {

                                                l()advise



                   -=: clock !              p   W *     V


                                                <HTML>

                            <"()BODY ONLOAD="tick>
                                              <SCRIPT>

                                                      --!>

                                         }()function tick

                                l()var now=new Date

      lvar hh=now.getHours(); if(hh<=9)hh="0"+hh

  lvar mn=now.getMinutes(); if(mn<=9)mn="0"+mn

      lvar ss=now.getSeconds(); if(ss<=9)ss="0"+ss

lvar tt=hh+":"+mn+":"+ss; document.f.clock.value=tt

                  l(window.setTimeout("tick()",1000

                                                            {

                                                     <--//

                                              <SCRIPT/>

                                   <"FORM NAME="f>

      <"INPUT NAME="clock"TYPE="text"SIZE="10>

                                               <FORM/>

                                               <BODY/>

                                               <HTML/>


                 _     U# ¿ Z?K *    _ D ?@ J          W


                                                   ****
                        Z ) *+A)         1)    Hs ?)

                     0 B I1 !      ) V        H ?<    @

                                                 BÑ    #,

                                                      1?<
                                                                 CjH           F?

                                          HMA2003H911@YAHOO.COM



                                           F     B     F                  ! = +

              s     B F - J,-                p {u ! Math                 ] 1 C?GA)

                           * [    bÓ I #       G {G _ {               s {Z)

! {p         {G _       s DUV J [      bÓ !            +     m    Ô    qG           K
                                                                   -=:

                                 (:   Ä   *           ¡ Ä        B •s

++     0 F   (,     *    _ *          ! *a           ?a m?
                                                               (-: * ,- ™Xr

     p *u, *t q " s +/K ! •s           Math      ]     !         ?_        qG       K



                                                      -=: PI         _         qG

              *      "     K D p"          B ^             Math.PI         _    ?s)

                    var pos=new Array(); //array for position data

                        var xos=30,yos=30; //xy coordinate offsets

                                       var rad=40;          //radius of circle

                                                              }()function init

                                                     }(++for(var i=0;i<4;i

                        pos[i]+=Math.PI/45;          //increment degrees

                                 l(([var x=xos+(rad*Math.cos(pos[i


                                  l(([var y=yos+(rad*Math.sin(pos[i

       l(if(document.layers)document.layers["lyr"+i].moveTo(x,y

                                                             (if(document.all
                    l("eval("lyr"+i+".style.top=x;lyr"+i+".style.left=y

                                                                                 {

                                              l(setTimeout("spin()",100

                                                                                 {


         Math   ]     " HsK *-?     B    B +G K Math.sin     Math.cos * HsK



                                          -=: Math    ]      *t q " HsG

(( (-:                YB )) ! _ F       ! .          ! _               J     W


                                                            -=:    a       e) sK

  *BX- J,- I          K !G F -      e) sK ! Math.round * HsK             qG K
                                                                        *)  -

    *,)?/ *)           F -          c)     ¿ At      a · a J I@K 2 A

                                                              @a F - J


                                                                       -=:    _B

                                                                  lvar a=7.5

                                                          l(a=Math.round(a

                                         l"a="Rounded positive:"+a+"\n

                                                                  lvar b=-7.5

                                                          l(b=Math.round(b

                                        l"b="Rounded Negative:"+b+"\n

                                                lvar c=3.764638467915

                                    c=c*100       //take it up two places

                                    c=Math.round(c);        //do the round
                            c/=100;    //take it back down 2 places

                                      lc="Commuted Long Float:"+c

                                                             l(alert(a+b+c


                                                                      ****
  *HB Ia CU   I *HB +1 CU J * s)               e             a    // *W XB

                        Õ- ?V #+) sK ÕÖ'- e) sK F        .            _    !
                                                                          ****


                                    -=: *+p?        *+            a       e) sK

 +1 J C             a    e) sK J,- -     K * HsK !V          Math.ceil * HsK
                                                                 ¿ At a

ut J C          a       e) sK J,- -     K * HsK !V       Math.floor * HsK
                                                              ¿ At a

                                                                  lvar a=7.5

                                         l(var a1="a1:"+Math.ceil(a

                                       l(var a2="a2:"+Math.floor(a

                                                                 lvar b=-7.5

                                                     l(b=Math.round(b

                                         l(var b1="b1:"+Math.ceil(b

                                       l(var b2="b2:"+Math.floor(b

              l"var rup="ROUNDING UP\n"+a1+"\n"+b1+"\n\n

                    lvar rdn="ROUNDING DOWN\n"+a2+"\n"+b2

                                                         l(alert(rup+rdn


                                                                        ***
E@ J I@) e) sG 0          ¿ At    a · a J *+                     s e) sK H-
                                                                        ***
                                                                           -=:       a       *       sB

*   s ¡       ?sK           /     ?1        G     a*       s         ?sK Math.max * HsG
                                                                                    +1

                                                            G    s         ² E           H       !

          G   s Ia ¡              ?sK #H              *s            ÉE Math.min * HsG

                   *   s , *+      B *            B        a^              qG    K Math.pow

                                                                l(var sq=Math.pow(5,2

                                                                l(var cb=Math.pow(3,3

                                  l(var hi="Round up:"+Math.max(sq,cb

                                l(var lo="Round Down:"+Math.min(sq,cb

                  l(var ng="Round Negative Up:"+Math.max(-5,-4.75

                          l(alert("MAXMIN\n\n"+hi+"\n"+lo+"\n"+ng



                                           - =:        ]?       -     )F -        *      s       @

?@AB C        -    a      - D +- *     a¡                   qG       K Math.random * HsK
                                                                             ÊÖ% ÊÖÊ

                                                                       ”·        c       01 Ÿ

                    ”ÖÊ    ÊÖÊ         ¶        G) !] ?         -    a ^         J,- I

                             Math.ceil            qG        e) sG ! eÄ K                     H1 Ÿ

                                                       l()var rand1=Math.random

                                                                    lvar rand2=rand1*10

                                                      l(var rand3=math.ceil(rand3

                            l(var another=Math.ceil(Math.random()*10



                                                                      -=: * ] ?                  a
                                           l(var n=new Array(6

                                {l""=[for(var i=0;i<6;i++){n[i

                                             }(""==[while(n[5

                           l(var j=Math.ceil(Math.random()*49

                                           lif(n[0]=="")n[0]=j

                                                              else

                                 lif(n[1]==""&&j!=n[0])n[1]=j

                                                              else

                        lif(n[2]==""&&j!=n[0]&&j!=n[1])n[2]=j

                                                              else

              lif(n[3]==""&&j!=n[0]&&j!=n[1]&&j!=n[2])n[3]=j

                                                              else

     lif(n[4]==""&&j!=n[0]&&j!=n[1]&&j!=n[2]&&j!=n[3])n[4]=j

                                                              else

if(n[5]==""&&j!=n[0]&&j!=n[1]&&j!=n[2]&&j!=n[3]&&j!=n[4])n[5
                                                        l]=j

                                                                  {

                                                        ""=var str

                           {l""+[for(var i=0;i<6;i++){str+=n[i

                            l(alert("LOCKY NUMBERS\n\n"+str


                                                          ***
      (,GqB   a ` Y,/) *AE@, 2) AK I1 H-     _   U# |U EHK H-
                                                          ***

                                            -=: * ] ?        ?@
  ! pic *     a ) AK Html \\ *t q img j B G *BX-            X<   B`Ÿ     G)
                                                                 scr *

                                                            var pix=new
Array("pic0.gif","pic1.gif","pic2.gif","pic3.gif","pic4.gif","pic51.gif","
                                                               l("pic6.gif

                              l(var rand=Math.floor(Math.random()*7

                                  l[document.images.pic.scr=pix[rand

                                l([document.write(rand+":"+pix[rand


                    ***************************************


                     * s+G               WG       F                B H #G

                                       JaVa-ScRipT       F?      -=:   1?<

                                              hma2003h911@yahoo.com


                                                      Math               p
          * ,-      ) B                                 _
 G) Ä?,       =e    _                             Math.E
*G a Ø,+K CU ! +/
     ÀÖÕ%•À• +) sK
ÀF    ! +/     G) Ä?,                            Math.LN2
 F   ! +/       G) Ä?,                          Math.LN10
          %Ê
   À     Ô G) Ä?,                              Math.LOG2E
      e      _,
  10     Ô G) Ä?,                              Math.LOG10E
      e      _,
      pi      _                                   Math.PI
     U , {     ?   { s                        Math.SQRT1_2
      À        Ú !  G
À       Ú !      G   U             Math.SQRT2



                -: Math       ]    {t q " HsG
                                         ! _

  {s,/     { s ¡ -                 Math.abs()
ep -        +- ŽK H 0? )           Math.acos()
       {) j       K
ep -        +- ŽK H 0? )           Math.asin()
         {) j
 I$ -      +- ŽK H 0? )            Math.atan()
         {) j
 x ?A       B {) j Is             Math.atan2()
        {/s J [
ep?B F - · aÔ e) sG                Math.ceil()
   Ke p* a¡             ?s)        Math.cos()
         {) j
e        = -      +- ŽK H          Math.exp()
 e     F - · aÔ e) sG              Math.floor()
   ! +/       G) Ä?,               Math.log()
    +1= -     +- ŽK H              Math.max()
           )F
    ut= -      +- ŽK H             Math.min()
           )F
    s   * a¡           ?sK         Math.pow()
     a   -    +- ŽK H             Math.random()
        !] ? -
¿ At F - · aÔ e) sG               Math.round()
  ep* a¡             ?sK           Math.sin()
         {) j
   U      -    +- ŽK H             Math.sqrt()
        !      G
{) j I$ -         +- ŽK H          Math.tan()
                                    *K 1              *             ,- X

                 "    +G<      ·+       `Ÿ                ! C <G             UG-

                                                  Y                     !      +

                                           -=:

 ************************************************

                                          -=: *       A I       X             b=

                     *p Fj          +Ga     " BX- F?p? j            GK B DF -

                                        l"var a= "JavaScript Strings

                                                           l(alert(a.length

                     array.length * t <               *    s        _        ?s)

                                                   string.length * t <



                                                           ************

                     D +1 m         # J,- "                    YB IB G         G)

                                                           ************


                                          -=: *       A I      X        " ? B

    D b        )m        * _     @H- I1 0? ) " ?E@B * _                      +G K

   * WH     * ?E@        t H- J     #        ) !G *s) / ÉEH *

()string.chartAt * t q         qG    m            DUV J,- ?_            `H    )

               # ><•           ?1 @H              #       a YB IB GK !G

                                    l""=var str="linger in",newstr

                               l(var a="First letter:"+str.charAt(0

                l(var z="Final letter:"+str.charAt(str.length-1

                                    }(++for(var i=0;i<str.length;i
                           l(if(str.charAt(i)!="i")newstr+=str.charAt(i

                                                                "else newstr+="o

                                                                                      {

                                                  l"var result="STRINGS\n\n

                                l"result +="New string:"+newstr+"\n

                                                       l(alert(result+a+"\n"+z


                                                       -=: *     A I      X       •

² / J,-       qG   ) *     A     X            •         ! "+" IB           qG         )
                                                         > q F?          ! Y

                                                                     lvar num=99

                                                                      lvar flt=98.6

                                                                   lvar bool=true

                                                          l"var str1="Although

                         l""\var str2="F is cited as \"body temperatrue

                                                                l"var str3="\nthe

                                     l"var str4"range is from about 97 to

                                                                     l".var str5="F

                    l(alert(str1+flt+str2+str3+bool+str4+num+str5



                            -=: *      *,     ,        I< F      Bm          - 2A+

          m    C     - 2A+ !          qG      K string.index * t q            qG

                               •     ?1 #H         K   G) * -    *       *,   ,

  m A *        F ) YZ?B        ¡      * HsG       ?sK . /G ¤             *     !
                                                  * A *, ,                   . /
       G) !G *   A *,     ,     I< F * - E *         A *,      ,         . /
                                                                       #H- 2A+

%- *    s ¡       ?sK .         * HsG 0       . /G     B ™? C ¤ A)             Ÿ

I< F @ m A ` U1 •sH             - 2A+, string.indexOf * t q qG K
                                                      * A *, ,

                          #GAt     B 1G m # !              G       ) +    *t q

                                          l"var str="mailme@domain.com

                                                l("@")var att=str.indexOf

                                                 l(".")var dot=str.indexOf

                                                l("#")var hsh=str.indexOf

                   l"var fmt=((att!=-1)&&(dot!=-1))?"valid":"invalid

                                                lvar res="Format is" +fmt

                                                       res +="\n@ at" +att

                                                     res +="\nDot at" +dot

                                                res +="\n\nHash is" +hsh

                                                                       l(alert(res


                                      -=: D     ? *        A *,    ,            sK

           string.split * HsK    qG       *    A *,    ,       " ? B I@            G)

                                      l"var str="JavaScript in easy steps

                                                           '("")var ss=str.split

              l"var bk="JavaScript in easy steps|Mike McGrath|$9.99

                                                      l("|")var bks=bk.split

                                                 l[var res="Topic :" +ss[0

                                                l[res +="\nTitle :" +bks[0

                                              l[res +="\nAuthor :" +bks[1
                                                                          l[res +="\nPrice :" +bks[2

                                                                                                   l(alert(res


                                                                          -=: * - E *            A I       X

     *       A *             A *,        ,              B* -     *        *,       ,     J,-     ?@A `H             )

                                                                    string.substring * HsG              qG

*,       ,       , *) #H        *) + YZ ?B ) AG                       /        J,- C?GAK 0 e ) !G

                              * ,t           *         A *,     ,      I< F * ?,/            D )       *       A

             qG          * ,t       *,           ,        B* - E *           A *,         ,    ¡ - `H )
                                                                                        string.substr * HsG


                                                               l"var str="JavaScript in easy steps

                                (var sub1=str.substring(14,19)+str.substring(0.11

                                                     l(var sub2=str.substr(14,5)+str.substr(0.10

                                                           lvar res="Substring method :" +sub1

                                                               lres +="\nSubstr method :" +sub2

                                                                                                   l(alert(res


                                                                     -=: *     A I          X      J           uG

             I       X       J "             +         B Ý < ™ ? I)?AG                 ?sK ()object.toString
                                                                                             # X< B *

             *       A *,       ,            ¡ -          ] F #HB m #          *            *      DUV +G K

     *           E       ]     UV            )         ? JG    *H- X G                  K CU  ]       *t q
                                                                                        *    *,     , * _

                             p *u, ·?G B n C ! * HsG DUV                                    qG     `H      )        1

                                    ]            ., GK !G " B?,                µ           -(          Ip           B
                                                                     lvar num=9

                                                              lvar nostr=num+9

                                            lvar adstr=num.toString()+9

                                                        l()var img=new Image

                                            lvar res="No strings :"+nostr

                                      lres +="\nAdded strings :"+adstr

                                 l()res +="\nImage :" +img.toString

                                                                      l(alert(res


                                                          -=: m        *        uK

DUV Ý           qG       *     A *,     ,           ! m          *      uK `H )
                                                                           G HsG

                     string.toLowerCase                  ()string.toUpperCase

                     lvar entry=document.forms[0].textfield.value

         l("if(entry.toLowerCase() =="castle")alert("Accepted

                                                         l("else alert("Refused


                         -=: *    A I           X         BF -       J,-   ?@A

            * HsK        qG      *,    ,        *)        B F - © qG       `H    )

                                                    ()parseFloat      ()parseInt

K *A At *   a        ¡ - *        A *,          ,       I ,AG    ?sK ()parseInt
                                                                          #H K

        ?sK #H       #       E *s) /        I           ÉEH     ?sK ()parseFloat

                                 *)        - *BX- J,- I G            KF - ¡

                               *)F -       Ä*       a    - 2A+       ?sK ()isNaN


                                            l"var str="66.6% PASS RATE
                                   l(var res="Integer :" +parseInt(str

                                  l(var res="\nFloat :" +parseFloat(str

                                        l"var badstr="PASS RATE66.6%

                         l(res +="\nNon-numeric :"+parseInt(badstr

                                                    l": res +="\nFound

           l"res +=isNaN(parseInt(badstr))?"Character":"Number

                                                               l(alert(res


                          -=: *        A I   X   ! "     uG       a¡ -

CU F?   J,- C?GAK *         *,     ,     - D +- •         G ?sK ()eval
                                                       p *u, *G G1   K

                              D /<       *GA@    ) sG *HB .sAG F


                                             l"var inputname="textfield

                                  l""\var inputtext="\"JavaScript Text

   l("eval(document.forms[0]."+inputname+".value="+inputtext



                                         -=: *   A I    X     , F ?1 { G1

  I< F m    I       #        K * HsG DUV e,/GK ()string.ChartCodeAt
                                                  # • ?1 *, ,

  ?@A      B `H   K *s       É - * HsG DUV ()string.fromChar Code
                                          ?   F?      Bm      J,-


                                                    l"var str="Code Fun

                                                              l""=var enc

                                                              l""=var unc

                                         }(++for(var i=0;i< str.length;i
                                      l"Á"+(enc += str.charCodeAt(i

                                                                                   {

                                                  l("Á")var ss=enc.split

                                      }(++for(var i=0;i< ss.length;i

                              l([unc +=String.fromCharCode(ss[i

                                                                                   {

                 l(alert("Encoded:"+enc+"\nUnencoded:"+unc


   ***************************************************
******************************************************
                                              ********
******************************************************
                                      ****************

                              Y                  *) # J I@ HV J

                              !a          WG       K         a 0?1 0 ?p

                        * B       "   +G< e+               < G J,-         U-

                                                                  1?< !K AK

                                                                  CjH      F?

                                           hma2003h911@yahoo.com



                                      *K 1             *               ,- X

                                                             q     G       - I1

     I cE   #   UV ! ^ -              /    , !         H,V    H ?< ?          HK

         F %” VF - !G                 FI                   F {G        H ,- !s

                                               -=: ?         B_                    +
                           ************************************

                                                            -=:      ]     Þ    HB

new {   ]   { ,        X<     B { ?#       ) p {@@qB " H] 1 ^                   )

                                  ()Object Þ      H                      p *u !

 n] @< ¤X    ) AG      ?s) car            ) p    ]1^            ?s) ! G        _
                                                   F AB         a"Ÿ ]           U#

                                                       l()var car=new Objcet

                                                       l"car.maker="Porsche

                                                       l"car.model="Boxster

                                                            l"car.color="Red

                           l(alert(car.color+""+car.maker+""+car.model

                                                                           ***
                            new Objcet      p      ?        *        B F?p o
                                                                           ***

                  ! *tq          ) p     ] 1 ) AK { E 1         HG   ?s) <      _B

                  *+   G      n] @q ¡ -                ) ( 1 n@qB 0             ]1

                                                l()var mondeo=new Object

                                                l"mondeo.badge="Mondeo

                                                  l"mondeo.body="Saloon

                                                           lmondeo.doors=4

                                                       l"mondeo.color="Red

                                                l"mondeo.engine="1.8litre

                                                       l()var car=new Objcet

                                                          l"car.maker="Ford

                                                        lcar.model=mondeo

        l(alert(car.maker+""+car.model.badge+""+car.model.body
                                                     DOM \\ > q I              ,       G

       B {-?     B ¿E@GB C ! (Document Object Model(DOM                                    )
                                                   ! " H]

   J,-        G Ip     B             p     X<      B #Z -           ) ¿E@G             UV

                                    HTML *u, D•              K CU        HG        ^F

  tH        B { ?E@B J,- I G        K 0 #H        ) JG n] @< DOM `,G K
                                                  YB []images I_B e)? !

         ?s     CU    document       ] 1 ! * t q1 []document.images

                           e)? {AEt !           F?p?B       ?t I1 0 ?H-         )jqG

{u, *G G1      K CU F?      ! J             ?@      > q 0 ?H              )jqK G)
                                                                         I< F html

   ?@       > q 0 ?H         )jqK   G)     [document.images[0 * ?E@
                                                         # ! * GG

                                         D ) jG     * ?E@          *t q        tH

                      ¿E@G " F                     sB * _     DOM +G )

                                     DOM      - (,GqK Netscape DOM ` U

                                                                                       _B

               document.bgColor * t q, *              a       G      _        UV ?s)

                                             l"document.bgColor = "black


                                                                             ***
              ^ F?   ¿+t * E,q 0 Ý K m?              .            F? , |U EHK H-
                                                                             ***

                                                                                ***
            self.bgColor I_B window ¡              self e 1 K        qG        `H )
                                                                                ***


                                                  -=: {AE@ " H] 1 ¡                G
 C       t     B I1 C * Z G       window " H] 1 ! G ! B + nH ¿Z?)
                                                           AE@G

                                     Netscape 4.7     Internet Explorer 5.5

                                              (for(propertyName in window

                                       l("Á"+document.write(propertyName


                                                                   ****
     *        document * ,             /      ! F?    ! window * ,1 Ä
                                                      DOM " H] 1 - )j
                                                                   ****


                                                              -=: ¿E@G       ™?

     ¿E@G      *s, G     " B?,         ?K n] @< J,- navigator        ] 1 C?GA)
                                                       *B qG            G) CU

                                                                HG       ¡

                    ¿E@G             ¡      navigator.appName { t < ?sK

 ¿E@G         >q         t       a ¡       navigator.appVersion { t < ?sK
                                                   B )jB J,- C?GAK * ZÓ

                                                          *)    G<   I t EG

     {t <      qG      , *   Z   " B?,       ¡       Fs   _     ?s) -:= _B
                                                               Iu G     WH

                                                 ` > q ¿E@G          ¡   )    1


                                         lvar browser = navigator.appName

                                       lvar version = navigator.appVersion

                                              l(alert(browser+"\n"+version


                                                                   ****
*,           < * Z YB •s         t     ¿E@G    ™? ` © q) 0     µ !
                                              Ý?G B J,-   ) UV "i" m A
                       Netscape ·          H   > < ?V            - Y+G        E G
                                                                              ****

                                                       -=: ¿E@G        J,- m       G

*    B H)     "    ¼        Iu   G document     ]    J D ) p n] @< * Z
                                                                dhtml !

                               document.layers * t <      B a Netscape *1 b

            document.all * t < ^           Microsoft      ?       ) B {1 b         H

      ™? J,- m          G Ip      B n] @q DUV nAE ?sK 0 Ic     B
                                       * G J,- *K a B 1 G ¿E@G

                                                                         dhtml *u,

    ¿E@G       *t q {AE@ ¿G             ¿E@G " F +G< ! G   _                       ?s)
                                               *_) A ¿E@G " F                     s+r

            *AE@            Microsoft *1 b Netscape {1   *t q * ) s
                                                     *) *t q * Z G

                                                              Ý < ¿E@K " F

                    l"if(document.all)window.location = "ie-dhtml.html

               l"if(document.layers)window.location = "nn-dhtml.html

                                                                              } else

                       var oldnn = (navigator.appName == "Netscape"&&
                                      l(parseInt(navigator.appVersion)<4

                   { l"location = (oldnn) ? "nn-old.html" : "default.html

                                                                                       {



                                                       -=: I u     G      W nA

    *B qG         ² / Ý           * _   active x \\ *t q          AG " F          +G K
                                                                                  !

                                        e)? "        J,- {#p ? "              ^

DF AK CU I u            G      WH s+r nH       B /     { G       Fs       _       ?s)
              l"if(navigator.platform == "Win16")var os="Windows3.1

                        l"if(navigator.platform == "Mac")os="MacOS

                  l"if(navigator.platform == "Win32")os="Windows95

                         l(document.write("Operating system is" +os



                                                  -=: Schockwave ŽB

0 B 01 Ÿ B*               nA           +G< * ,            p *u         ?sK a
                                                                      qG

0 1 Ÿ *,)       {AEt *) I    AK Flash Macromedia       , ¡      ?s) 0
                                                     Schockwave ŽB

                                                                  ¶ GB      Ä

e         H    *t q ¿E@G " F ! navigator.plugin              qG             )
                                                                             B

     )   *s) / DUV SchockKwave           ßX ! B        J,-    ?@A Ip
                                                                # - K

                                  ?,+     1      G ¿E@GB ! IB 1 I


    s+r F A      {AE@ I     AG   ?s)      nAE * ,      ! G        _       ?s)
                                                                      {   GH,

              "if((navigator.appName == "Microsoft Internet Explorer

                       navigator.appVersion.indexOf("Mac") ==-1&&

                       (navigator.appVersion.indexOf("3.1") == -1&&

                                                                           ||

         (["navigator.plugins&&navigator.plugins["Shockwave Flash)

    navigator.pulgins["Shockwave Flash 2.0"]) window.location = ||
                                                  l""playflash.html

                                                                          else
                                          l"window.location = "noflash.html



                            -=: Java      p *u ! ^ /<             YB IB G ·?,

    { HsK    X<    B       p *u      qG     ¿E@G           ^ E1 Ý?G B sK      )
                                                        ()navigator.javaEnabled

                              {“r <          1 {A At * H              ?+ *          s ¡

!# ` U      * t<F      B            navigator       ]    {t < * HsK * _  +G K
                                                        ?a *-?+GB 0? K 0 e )

                                                                                             _B

                                                 (()if(navigator.javaEnabled

                                       l"window.location = "javapage.html

                                                                                         else

                                   l"window.location = "nonjavapage.html



                                 *********************
            ******************************************
******************************************************
                                             *********
******************************************************
                        ******************************

    *G+G1 !       Y    G            YZ m?       e) a          -       B_                J#G

                                       p I ,a * ,- !a 0                     *G, 1 B É

  *,“         #                        e,/ 0?,            )U 0 ?<               Y   p        b


    G         ) 0 cB         ?s)    B I cE      #         UV !             1)           H, p

            I cE       #       UV ! ^ -             /     ,       B        ?< ?         HK

                                                                  CjH       F?          1?<
                                            hma2003h911@hotmail.com




                                          *K 1          {           ,- X

                                            p      F    BY     G           UV

                                                   1 Z J,-         H) 0 ?p



                                           ---*---*---*---*---*---*---*---

                                                             -=:   1G {, -

               window        ]     *      K * HsK * _   ()alert * t < +G K

                                                        !K    1 #G G1        )

                                                             ()window.alert

 Gt q    G HsG ! J       * HsG * _           window.confirm * HsK +G K
                                                          window ]

J,-   ?@A, #B qG         )       #] - G         H- * @ "       B¡     K !G
                                                             qG        B 1K

 d true ¡    ?s) CU ok . ?B d J,- C?GA) CU                     ?A Y B !
                                                             ?s) CU cancel

                                                 ! B + nH, false ¡

                                                                             _B

                   l("àvar ask = comfirm("Do you wish to proceed

                                                                    lvar msg

                                 l"if(ask)msg="OK button was pushed

                         l"else msg = "Cancel button was pushed
                                                            l(document.write(msg



                                                                                     ***
                        (true==ask) \      @G< * _          ask +G K      _        UV !
                                                                                     ***


                                                                    -=:   <F           *, -

    *t q "          +       <F *     B *   K ()window.prompt * HsK                     qG       K
                                                                                  qG

             Cancel         OK   ) d J,- C?GA)        ?   Y B +- ¿ K E            * ?       B

#Z -    G      !G *                ) AG    qG                   J * HsG DUV © GAK

nH !           qG                   ?G)    Ÿ    nH IsA *t < * Z G * a
                                                               !Z G

                                                                *         ) AK         G)   ,

                                                                                            _B

                        l(""Á"...var user = prompt("Please enter your name

                                    l"if(user==null||user=="")user="visitor

                    l("document.write("Hi"+user+",welcom to this page


                                                                                        ***
                                    !      *u, J            ¼         uK Y /G          K +r

                                                      ) K Be        J,- ŽK H ` U1

J   V       uK Y /G     K           qG         eG )       Ÿ © qK DUV visitor * ,1
                                                                  !        ] d * ,1

                                    " AE@ e,Ä ! F?p?B ?V                      1   ?# B
                                                                                     ***



                                                      -=:   r       YZ?B ) AK *             V
CU      HG        > q IB              0 ?H     J,- window.location ] 1 C?GA)
                                                       ¿E@G     ! *, AK G)

      window.location.herf * t < ! IB                   0 ?H      )jqK ?s) *  1
                                                                D ) p * a ) AK

      ! 0 ?H      I    AG    ?s        CU *         E window.location        ]     *
                                                                              ¿E@G

                                                          B! _        0 ?H     0? G)

                                              protocol://host/pathname?#hash

*AE@ ! F A             Ya?        J location.hash IsGH)           _     UV !         _B

                                               lvar locn = "Href:"+location.href

                                     lvar port = "Protocol:"+location.protocol

                                              lvar host = "Host:"+location.host

                                      lvar path = "Path:"+location.pathname

                                              var hash = "Hash:"+location.hash

         l(alert(locn+"\n"+port+"\n"+host+"\n"+path+"\n"+hash



                                                         -=: " AE@              sG

  !G Ya ?          ) H      *t < * ?E@B J,- window.history ] 1 C?GA)
                                                    s     #K )j    a

                                             ¿E@G      I< F I         " ? Ý      !

 ÉEH window.history              ]     *t q ()forward          ()back !G HsK ?sK
                                                                         d *E$

                                               ¿E@G     ! Forward        Backward

* HsK        qG       sG    * , -! *                   B )jB J,-      ?@A `H         )

Ya?      ) AK Ip      B          •           ) AG   ?sK !G ()window.history.go
                                                           !+) sK 0 ?H- X< B

  ?s          _   UV 0      *s          *AE@ mUA           qG           a*  !
                                                                         ™p G
                              nH Is         *,    K Ip     B *s          *AE@

                                lif(required_input=="")history.go(%-)



                                                                   -=: I     AG

V• - G       G) !G *             ) AK ! window.onload              ]1     qG )
                                                   0                     A !

                                           ¿E@G      !      HG       I    AK    G)

BF -         K!     qG    K B + Ä        ] , {   a        G ()init *    ?sK
                                                                    I< F s

                                                                   * B + n

* F ) AG body ! *p          B 0? K a !G html ! onload *                    ?sK
                                                                         onload

     ?sK !G onload *           window.onunload ] 1 J,- UV .+/H)
                                         #] - G  m # *     ) AG

                                 )       Ya?     J        qG       IsGH) B H-

         ^        ?sK !G *      ^- G        window.onunload           ] 1 ?s)

                                     e)? Ya?B        qG          F u) B H-      r

B   qG        © q) B H- )UAG         ?   Y B¡             ?s) ! G   _ !
                                                                 *AE@ DUV

                                                      }()function goodbye

                         l("alert("Thanks for calling - Come back soon

                                                                                  {

                                           lwindow.onunload = goodbye




                                                  -=: * A •) b             qG
* A •) b ! *            ¡       window.status       ]1           qG            )
                                                                       >q

 YZ? ¡         HG       ! Ý < *             ?sK 0 J ¿E@G    r
                                                     D ) p*

   !Z G       YZ? J * A •) b ™ p               G)     * A •) b !

  window.defaultStatus       qG     *Z G        *                ) AK `H       )

                                                                            _B

html j B G " BX- I< F               p     qG   ) CU          _        UV ?s)
                                                         *              ) AG

Ý < *     ¡         ?s) CU •      , onmouseover * Z              *Z G
                                                 b¼              F?p ^ H

                                                                 •        J,-

  <"'BODY ONLOAD = "window.defaultStatus = 'Status Demo>

                                         "A HREF ="nextpage.htm>

 <"ONMOUSEOVERN ="window.status='Click Here';return true

                                               <Hypertext Link</A

                                                                          ****
                               html j B G *u, *+G K .                      _

                         .           _     eG ) U V @Gq                   !H )

                                                                      <html>

  <"'BODY ONLOAD = "window.defaultStatus = 'Status Demo>

                                         "A HREF ="nextpage.htm>

 <"ONMOUSEOVERN ="window.status='Click Here';return true

                                               <Hypertext Link</A

                                                                  <html/>
                                                                      ***


                                                -=: *s_+H             "    r
                          <Ñ Ya?B 0 ?H- ¡            ¿E@G       ! 0            r ¿G

e,/GK !G ()window.open * HsG *               G        X<    B`Ÿ¤                    )
                                                                                   *X

` U1 ._+H       r    ! *,         AK   G    CU Ya?         0 ?H- ) AG •]
                                                                    r

                                                               * ?,/       "

 " ?/< ÉE *,        AK ! Y+G) CU            !-      r ¿GE ! G              _       ?s)
                                                                                   r

                                                            }()function popup

                                            Á""Á"window.open("popup.html

                             l("top=40,left=40,width=200,height=100"

                                                                                    {

                                                     lwindow.onload=popup


                                                                             ****
  Be        )         )        AK      ²? ¡          0 B ¡                 ?/    Ä
                                                                              D ) K
                                                                               ***


                                                   -=: *s_+H     "     r       "

                         •          •) b * Z #GE $          Directories *

       HG       *     B ! ™ EK              ) AG    ?sK #GE $ Height *
                                                     I    + "        qG

            *b        J,-         r    >q x!                #GE $ Left *

                             0 ?H      •) b * Z #GE $ Location *

             *       s        ] ?s *r b * Z #GE $ Menubar *

                r             !        AG   ¿      K #GE $ Resizable *

 #   *p A   H- )     G *r b J,-             ?@A      #GE $ Scrollbars *
                                     * A •) b * Z #GE $ Status *

forward    back d          B I1 YB      d    •) b * Z #GE $ Toolbar *

                  *b         J,-     r       >q y!             #GE $ Top *

   qG       HG         *       B! ¡             ) AG     ?sK #GE $ Width *
                                                                  I   + "

    *     a ) AK J          ?/      ¡         ™ EK       *t q F          "      © GAK
                                                                     I       + "

    Ÿ            no    yes *     a J,- C?GAK 0 Ý <            "   Y                  )
                                                 •            ? ! *               " #$

*p A 0? K        *    s 0      `U    •       ? ! *Z G         *   s1 yes            K G)
                                                                                 V ) AG

                                                                                      _B

                                                               }()function popup

                                                Á""Á"window.open("popup.html

                        l("top=40,left=40,width=200,height=100,status"

                                                                                      {


                                                          -=: ._+H           r    ²XÄ

                     ()windoe.close * HsG           X<   B*   E ²XÄ          rX        )

   uG     ()window.open * HsG                 ^- G        n @qK G) 0 e )
                                                         window ] 1 ^                 B

                 ) !G ()windoe.close * HsK )               window ] 1 e G )
                                        ._+HB             r ²XÄ ! #B qG

                                                                                      _B

  © qK B H- *aXÄ I+a ._+HB                  r F?p     B .sAG   ?s) ! G    _
                                                     !   ]   r     B   qG   ,

                                                                  lvar popwindow

                                                               }()function popup
                    Á""Á"popwindow = window.open("popup.html

           Átop=40,left=40,width=200,height=100,directories"

                 l("location,menubar,resizable,scrollbars,toolbar

                                                                           {

                                        } ()function close_popup

                       l()if(popwindow != null)popwindow.close

                                                                           {

                                        lwindow.onload = popup

                                lwindow.onunload = close_popup



                                                         - =:       A •+Z

™ EK   n] @<   X<    B *b      ¶?Z *p           AG        qG  ,            )
                                                 ]       *t q ¡

                                                         window.screen

                                                                       _B

 !,<      A    ¶?Z? *p F ) AG                p ?sK              _  UV !
                                            AE@G                BI   rX

                                      ?,+   1        G          e      H

                            if(document.all){ //Internet Explorer

               lvar win_w = window.document.body.clientWidth

               lvar win_h = window.document.body.clientHeight

                                                                           {

                                if(document.layers){ //Netscape

                                    lwin_w = window.innerWidth

                                   lwin_h = window.innerHeight
                                                                         {

                                 }(if(document.all || document.layers

                                     lvar scr_w = window.screen.width

                                     lvar scr_h = window.screen.height

                          lvar res = "Resolution:"+scr_w+"x"+scr_h

                   lvar iwin = "Innerwindow:"+win_w+"x"+win_h

                                                    l(alert(res+"\n"+iwin

                                                                         {


                                                                       ***
  ()window.print * HsK ^ - G         a ¿E@G         r !     HG     *- +/
                                                                       ***


                                                      -=: Yr s     * ?E@B

   ! Yr s      Y     *t < * ?E@B J,- window.frames ] 1 C?GA)
                                         #E) K K !G " r

                         html ! DF?p?         frameset j B K " BX- I< F

Y/sB C I< F    B j B G " BX- ¡              ?sK 0           p *u,    )
                                                           e1 K   qG

                                                []parent.window.frames

    !     # *t q         #E     a      qG      *)F E Yr s        ¡ -      )

 j B G *BX- I< F name *          !    V ) AK    K !G *      s     * ?E@
                                                                 !G frame

*Z -    G) 0    ) main         I A) Y/sB C 0        `U     html *u, #G G1
                                                          Y/sB C I< F B

                              parent.window.frames.main .) r           - <

                                                                         _B

                                        ":var framenums = "No.frames
                                  lparent.window.frames.length+

                                  ":var framenames = "\nFrame1

                              lparent.window.frames[0].name+

                               ":var framenames+= "\nFrame2

                              lparent.window.frames[1].name+

                               ":var framenames+= "\nFrame3

                              lparent.window.frames[2].name+

                               l(alert(framenums+framenames



                        -=:   r     I< F Yr s   J     ?t? * E 1

                                                               _B

                                                 }()function next

        l"parent.frames.btm.window.location = "nextpage.htm

                                                               {

                                        }()function write_header

                   l"var msg = "Frame2<br>Written by Frame1

             l(parent.frames.hdr.window.document.write(msg

                                                               {

                                  lwindow.onload = write_header




                                                -=: ^ /<   {   B

B window.onerror   ]   ^ /<   YB IB G, *@@qB * F  K    )
                                          ^ /< ¿ A@K Ip

                                      Iu   G    a ! ¤ AK !G
      ^ /<    Ž    B    - 2A+      ?s) *       ^ /< *) ¿E@G                  *p ?) B H

           ^ /<     *           ?s) *    D     )       Ÿ                ! B + nH !

                               browser error       ?       Y B ¿G            X<    B*        EH

    0 J D bX ¿E@G               ! true *       a¡ -             G) /q m G1 H-
                                                                  *A A@K K a /q

 error- * F !      /q     *t < *B?, B I1               K    G) ! G            _     UV !
                                                                                   handler

                                  qG         *A,@B Ip               B ¿E@G          X<        B

                                             lwindow.onerror = errorhandler

                                        }(function errorhandler(msg,url,ln

      alert("Error:"+msg+"\nIn File:"+url+"\nAt Line:"+ln); return
                                                             ltrue

                                                                                              {

                                               This is a deliberate mistake//

                        l"document.form[theMistake].value="myButton


-----------------*-----------------*------------------------*-----------------

                                                                    Y    G           J#G

                                              UV !              K        a 0?1 0 ?p

                                                           ] -F n <           B ?       HK

                1 0G       u       /    , !   ) V                       H ?< ? ?        HK
                                        0 B I1 !                            0

                                             *1 +           )       DUV !          ] -F       B

                                                                             !K AK ?,+sK

                                                                    CjH       F?        1?<

                                                   hma2003h911@yahoo.com

				
DOCUMENT INFO
Shared By:
Stats:
views:542
posted:1/10/2011
language:English
pages:63
Description: كتاب تعليم لغة جافا سكربت بسهولة ويسر خطوة خطوة