O'Reilly logo

The JavaScript PocketGuide by Lenny Burdette

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

8. Client-Side Scripting

Up until now, I really haven’t covered any practical uses of JavaScript. You can go only so far manipulating simple data such as strings and arrays. JavaScript is a “scripting language,” which by definition operates inside some kind of environment. Usually, this environment is an HTML document in a Web browser. From here on, this book focuses on interacting with browsers, Web pages, servers, and user input.

Script Tags

HTML provides a means of including executable code in the form of the <script> element. You can include code in a Web page in two ways.

Inline Scripts

Inline scripts include JavaScript code directly in the markup, like this:

Inline scripts allow you to include your code as text right in the Web page. ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required