Skip to main content

Javascript Introduction

Hello guys, i'm gonna teach you something important that you all must understand. It's javascript!.

JavaScript is a script language in HTML codes and processed in client(browser).


What are the advantage of using Javascript? :
  1. Javascript can validate all input from user
  2. Javascript is dyanamic and interactive for web
  3. Javascript don't need a compiler to run
  4. Javascript is used in HTML,web,Computer application,laptop and so on
  5. Javascript can be run even offline.

   Let's write a simple script using JS : 






It will print "Hello world" in HTML.. , that's just a simple JS codes.

Location of JavaScript in HTML Document.

1. Internal

 <script> tag is written between <head> and </head> elements. To call JavaScript function, put the caller in the body of HTML documents between <body> and </body> elements.

2. External 

If you wanted to seperate your HTML documents and JS, you can use this method by:

<script language="javascript"> src = "url/file.js"></script>


Where "url/file.js" is the file that contains JavaScript code. If the "src" elements not included, the script tag will find the code inside the tag of script (internal)

JavaScript as "OOP"

What is OOP ?? OOP is "Object Oriented Programming". It means that Javascript treats the elements as object. Let's get straight to point so you won't be confused :D.

Illustration :

Park
  • Playground
    • Seesaw
    • Slide
  • Lake
    • Fish
    • Speedboat
    • Coins
From the illustration above, if you want to change the type of fish, you must access the "outer" first.
it would probabaly be : Park > Lake > Fish.type="Salmon" (example).

More content will be updated...

Comments

Popular posts from this blog

Cara menulis abstrak

Halo semua, sehat semua kan ? Nah kini saya ingin berbagi sebuah informasi bagaimana membuat sebuah abstrak yang bakal digunakan untuk penulisan ilmiah. Semoga tetap semangat belajar yaa! Pengertian Abstrak :  Abstrak  itu tidak lain ialah hanyalah sebuah ikhtisar/rangkuman keseluruhan dari penelitian yang sedang kita buat. Tujuan  utama dalam membuat abtrak ialah untuk memberikan gambaran awal  kepada pembaca supaya dapat memahami isian dari penulisan yang kita buat. Struktur pembuatan abstrak terdiri dari : Latar Belakang Tujuan Metode Hasil Kata kunci (keyword) Catatan : Abstrak selalu di tulis di awal karya tulis, dan diusahakan konsisten dalam spasi serta dibuat paragraf "Justify" untuk setiap pembuatan karya tulis ilmiah. Ditulis minimal 150-200 kata. Sesuai dengan KBBI, kalimat dari bahasa asing dicetak miring(italic) atau digaris bawah(underline) Pembahasan tiap struktur: Latar Belakang :  Secara umum, pada bagian ini kita m...