Tuesday
2024-03-19
8:35 AM
Section categories
Analisa [3]
Arabiatuna [1]
Barakatak [2]
Cerpen [1]
Figura [2]
Lenyepaneun [1]
Lintas Budaya [4]
Paguyuban [10]
Resensi [4]
Salam Rumpaka [2]
Serial Kampus [3]
Sorotan Utama [1]
Keputrian [3]
Warta Kita [2]
Statistics

Total online: 1
Guests: 1
Users: 0
Search
Site friends
  • Create your own site
  • My site
    Main » Articles » Paguyuban

    Masalah Browser

    -

    statement akan ditampilkan sebagai teks biasa pada dokumen

    HTML, tentu hal ini akan sangat mengganggu tampilan

    dokumen HTML anda. Untuk menghindari hal tersebut maka

    maka dapat digunakan tag komentar HTML <!--- --->.

    Sehingga syntaxnya akan menjadi seperti berikut:

     

     

    <script language = "javascript">

    <!--

    ---statement javascript

    ---statement javascript

    ---statement javascript

    -->

    </script>

     

     

    Secara sekilas masalah telah selesai. Namun ternyata tidak demikian,

    karena baris terakhir yaitu tag penutup komentar --->

    akan dianggap sebagai statement pada browser yang mendukung

    JavaScript, sehingga mungkin akan memunculkan pesan

    error ketika dieksekusi. Untuk menghindari hal ini maka di

    depannya diberi tanda dua garis miring (//) yang merupakan

    tanda komentar pada JavaScript. Sehingga sintkas umumnya

    menjadi seperti berikut:

     

     

    <script language = "javascript">

    <!--

    --- statement javascript

    --- statement javascript

    --- statement javascript

    //-->

    </script>

     

     

    Penggunaan Tanda Titik Koma

    Tanda titik koma ( ; ) digunakan untuk memisahkan statement

    yang satu dengan yang lainnya. Penggunaan tanda titik koma

    dalam Javascript bersifat opsional, kecuali jika beberapa statement

    dituliskan dalam satu baris maka penggunaan tanda titik

    koma sebagai pemisah menjadi keharusan. Jika tiap statement

    ditulis pada baris-baris yang berbeda, maka tanda titik koma

    tidak lagi diperlukan. Namun jika tetap dituliskan maka tidak

    menjadi masalah.

    Perhatikan contoh sintaks berikut:

     

     

    <script language = "javascript">

    <!--

    // syntax berikut benar :

    --- statement javascript

    --- statement javascript;

    --- statement1; statement2; statement3;

    // syntax berikut salah :

    --- statement1 statement2 statement3

    //-->

    </script>

     

     

    Komentar Program

    Kadangkala komentar atau catatan kecil perlu disertakan pada

    JavaScript. Fungsinya untuk memudahkan pemahaman kita

    terhadap alur program dalam script. Ada dua cara untuk

    memasukkan komentar dalam Javascript, yaitu

    a. Komentar satu baris, diawali dengan dua tanda garis miring

    ( // ). Jika komentar lebih dari satu baris maka, tiap baris

    harus diawali dengan tanda //.

    b. Komentar lebih dari satu baris, diawali dengan tanda /*

    dan diakhiri dengan tanda */.

    Perhatikan contoh berikut:

     

     

    <script language = "javascript">

    <!--

    // ini contoh kementar satu baris

    // kalau lebih dari satu baris

    // tiap baris harus dimulai dengan tanda //

    /* atau bisa juga dengan menggunakan

    tanda seperti ini untuk

    memberikan komentar lebih dari satu baris

    */

    //-->

    </script>

     

    Category: Paguyuban | Added by: fajar (2010-02-23)
    Views: 4348 | Comments: 1 | Rating: 0.0/0
    Total comments: 1
    1 lmatuwzh  
    0
    Access admission involving NBA The far east sweepstakes results in fry price range 6000 yuan previously treasured to 18800
    Last night, Nba authorities can be knocked officially made the decision the shin bone that will NBA China surpassed The year 2013, pond man or woman along with Trojan virus may portion being combined China when needed combining 18 nights on April Fifteen this season Shanghai each and every battle. The particular freeboard individual that is at China contemplating split comparing will be upset, could foreknow, this can be National basketball association Tiongkok sweepstakes any the most popular yr absolutely. National basketball association Cina involving prior to this Half a dozen a long time can be surpass, experienced seasoned a new orgasm, was up against trough similarly. Following Yao Ming retires, stern is at David to be able to relocated modest emperor a year ago Zhanmusi will be stored travel, your box-office income which The far east surpassed Next year furthermore is made brand new tall. Everyone knows on the other hand, department comparing simply may be the last trump card throughout Stern hand. Your assemble cash of the construct income the way the ticket in which challenge not necessarily otherwise this could happen China is overtaken truly will likely be horrible, the material is actually introduced last night, in tiny achieve, central heating boiler still having regard to be able to scamper throughout community forum. According to experience of throughout former decades, oriental competition front door priced can available prior to striking 1 numerous calendar month inside the go with merely outer put on purchase, yet have got method promote the home to acquired distributed an invoice on the web. Times reporter recognizes following the search which cleanse cherish, any have fun promoting the house par value totals for you to 6000 yuan coming from Five hundred yuan the doorway priced of Six school, included in this the 1st level an expense it's 18800 yuan (elemen price Six thousand yuan regarding) , improved compared to price range totally double considerably. Even though is such, gentle was recently a day, currently Three organizations clinch an offer. Additionally, lin Shuhao can steer a catapult to achieve Filipino Manila within Taipei, show up at conflict with pedestrian a couple of. (Guan Wucheng)

    Name *:
    Email *:
    Code *: