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? :
It will print "Hello world" in HTML.. , that's just a simple JS codes.
JavaScript is a script language in HTML codes and processed in client(browser).
What are the advantage of using Javascript? :
- Javascript can validate all input from user
- Javascript is dyanamic and interactive for web
- Javascript don't need a compiler to run
- Javascript is used in HTML,web,Computer application,laptop and so on
- 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 :
ParkIllustration :
- 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
Post a Comment