1 / 24

Pemrograman Javascript

Pemrograman Javascript. Teknik Informatika Universitas Bunda Mulia Jakarta Chandra Hermawan H., M.Kom ., MM. ?. Commit, Accountable, Respect, Excel. sincere. smart. Pribadi yang Cerdas. Berhati Tulus. helpful. diligent. Suka Membantu Sesama. Rajin dan Tekun. Ketentuan Umum.

duke
Download Presentation

Pemrograman Javascript

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PemrogramanJavascript TeknikInformatika Universitas Bunda Mulia Jakarta Chandra Hermawan H., M.Kom., MM.

  2. ?

  3. Commit, Accountable, Respect, Excel sincere smart Pribadi yang Cerdas BerhatiTulus helpful diligent SukaMembantuSesama RajindanTekun

  4. KetentuanUmum • Maksimumterlambat 30 menit, lewat 30 menitabsensitidakdiperhitungkan • Diharapkanaktifberpartisipasidalamkelas • Tidakmenggunakan laptop di kelas • Tidakmengaksessitus FB, Twitter, dansitusjejaringlainnyaselamaperkuliahandan lab • Setiappelanggaranbutir 3 dan 4 akandiperhitungkanpadanilaiakhir (-10) • Dilarangmengkopihasilkarya orang lain saatujian / tugasmandiri • Materikuliahdapatdidownload di http://chermawan.blog.ubm.ac.id • Pertanyaanseputarmateridapatdisampaikanmelalui email chermawan@bundamulia.ac.id

  5. BukuReferensi • Abdul Kadir. (2003). Pemrograman web, mencakup : HTML, CSS, JavaScript dan PHP. 1. Andy Offset, Yogya • Shelley Powers (2010). JavascriptCookbook. O Reilly, USA • Danny Goodman (2001). JavascriptBible. HungryMind Inc., New York • Tim Dosen (2010). ModulPemrogramanJavascript. UBM, Jakarta

  6. Start Your Engine

  7. ApaituJavascript ? • BagaimanacarakerjaJavascript ? • Apaitu Java ? • PelajaranPertama JavaScript • JavaScript Statements • JavaScript & HTML forms

  8. ApaituJavascript ? Adalahbahasapemrograman script yang paling populerdigunakan di Internet (wikipedia): • Javascriptdirancanguntukmenambahinteraktivitas • Bahasa scripting yang digunakanringan • Javascriptumumnyadiletakkanmenjadisatudengan HTML • Setiap orang dapatmenggunakanJavascriptsecara gratis • Javascriptmerupakanpemrogramanterbuka

  9. MengapaJavascript ? • Keterbatasan HTML • Text, images, tables, frames • Memungkinkanadanyainteraksi • Memungkinkanadanyaperubahanpadatampilan • Pemrogramansederhana yang mudahdipelajari

  10. Yang BisaDihasilkan • Tampilan yang lebihmenarik • NavigasiSitus • PerhitunganMatematik • Validasi input • Pengembanganlainnya

  11. Cara KerjaJavascript • Tergabungdalamkode HTML • View source • Dijalankan di sisipengguna (client) • Dapatdikombinasikandengan tag HTML • Tidakmemerlukanaplikasi lain selain browser

  12. Javascriptvs Java • Javascriptsangatberbedadari Java • Java merupakanbahasapemrogramanlengkap, sedangkanjavascriptmerupakanbahasasederhana • Java lebihkompleks • Java perlu di-compile dahulusebelumdigunakan • Java tidakharusberjalandiatas browser • Java danJavascriptdapatdigabungkanpadasebuahhalaman web

  13. MembuatJavascript • Memerlukansintakskhusus<script> </script> • Belajardasarnya, pelajarijavascript orang lain • Dibuatmenggunakan text editor, dandijalankanmelalui web • Perluketelitiandankesabaran, pesankesalahanpemrogramanseringkalimembingungkan

  14. Javascript Statement <html> <head><title>My Page</title></head> <body> <script language="JavaScript"> document.write('This is my first JavaScript Page'); </script> </body> </html>

  15. HTML dalam JavaScript Javascript Statement <html> <head><title>My Page</title></head> <body> <script language=“JavaScript"> document.write('<h1>This is my first  JavaScript Page</h1>'); </script> </body> </html>

  16. Javascript Statement <html> <head><title>My Page</title></head> <body> <p> <a href="myfile.html">My Page</a> <br /> <a href="myfile.html" onMouseover="window.alert('Hello');"> My Page</A> </p> </body> </html> JavaScript dalamHTML Event

  17. Javascript Statement <script language="JavaScript"> window.prompt('Enter your name:',''); </script> <form> <input type="button" Value="Press" onClick="window.alert('Hello');"> </form> Event Tandapemisah: " dan '

  18. HTML Form danJavascript • Javascriptsanganbermanfaatuntukmemproseshalaman form pada html • HTML <form> akanmenerimamasukkandaripengguna • Form danelemendari form memilikinamaunik, dimana: • Masing-masingelemen form dapatdiidentifikasi • Menggunakan JavaScript Document Object Model (DOM)

  19. Penamaan Form danElemen Form <form name="addressform"> Name: <input name="yourname"><br /> Phone: <input name="phone"><br /> Email: <input name="email"><br /> </form>

  20. Form & Javascript document.formname.elementname.value Contoh: document.addressform.yourname.value document.addressform.phone.value document.addressform.email.value

  21. ContohSederhana <form name="alertform"> Enter your name: <input type="text" name="yourname"> <input type="button" value= "Go" onClick="window.alert('Hello ' + document.alertform.yourname.value);"> </form>

  22. Tips Pemrograman • Pastikan statement dalam 1 baris program • Pastikantandabaca " and ‘ • Perhatikanpenulisanhurufbesardankecil • Permudahpembacaankode program menggunakan tab • TelitidanSabar

  23. THANK YOU

More Related