Cybershoutz

Diberdayakan oleh Blogger.

resume desain web (pertemuan 8)

Javascript

Scripting Loops
Dalam Javascript terdapat dua macam perulangan yaitu :
      - For : perulangan berdasar junlah yang ditentukan
      - While : perulangan selama suatu kondisi dinyatakan benar
 
Events

By using JavaScript, we have the ability to create dynamic web pages. Events are actions that can be detected by JavaScript.
Every element on a web page has certain events which can trigger a JavaScript. For example, we can use the onClick event of a button element to indicate that a function will run when a user clicks on the button. We define the events in the HTML tags.

Scripting Error Handling
When browsing Web pages on the internet, we all have seen a JavaScript alert box telling us there is a runtime error and asking "Do you wish to debug?". Error message like this may be useful for developers but not for users. When users see errors, they often leave the Web page.
The try...catch Statement
The try...catch statement allows you to test a block of code for errors. The try block contains the code to be run, and the catch block contains the code to be executed if an error occurs.



Facebook Twitter RSS