Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.


  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • DownloadDownload
  • PrintPrint
Share this Page URL
Help

JavaScript 101 (like "scroll that heading from left to right" or "pop up an ad for fudge-flavored toothpicks in a new window"). Scripts are written in a simplified scripting language, and even if you don't know all the ins and outs of a language, you can often copy and paste a cool script from another Web site to get instant gratification. Two examples of scripting languages are JavaScript and VBScript (a scripting language that uses syntax that resembles Visual Basic). This chapter focuses exclusively on scripts created with JavaScript, the only script- ing language that's reliably supported on most browsers. JavaScript 101 Now that you've learned a bit about JavaScript and why it exists, it's time to dive right in and start creating your first real script. The <script> Tag Every script starts with a <script> block that you slot somewhere into an HTML document. Really, you have only two options: