5. October 2009 23:50
What can you do with JavaScript?
If you’ve ever rolled your mouse over an image and the image changed, that is most likely caused by JavaScript. With JavaScript a designer can add some dynamic behavior to their website. The main features of using JavaScript are the ability to:
- Dynamically write HTML code into you webpage.
- You can set up events that will occur when a user does an action, such as clicking a button. Code can be set to run when the page loads or can contained in methods that require an user action.
- JavaScript can be used for data validation. For example, making sure all fields in a form are filled out or contain the right kind of input.
- JavaScript can detect the type of browser your user is on and load an alternate page designed for that browser. This used to be more important.
- JavaScript can be used to pass and store data in the form of Cookies. The data a user fills out on a form can be passed to another location through a Cookie.
JavaScript is used by embedding Script codes in with your HTML code.
Opening this page will cause the text “Dynamic Page Writing” to appear on your screen.
<html>
<body>
<script type="text/javascript">
document.write("Dynamic Page Writing");
</script>
</body>
</html>
More to come.
6149d817-d455-4fbb-92a3-f299ec0d46ce|0|.0