Tham khảo sách 'javascript bible_ chapter 5', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Scripts and HTML Documents In this chapter s tutorial you begin to see how scripts are embedded within HTML documents and what a script statement consists of. You also see how script statements can run when the document loads or in response to user action. Where Scripts Go in Documents In Chapter 4 not much was said about what scripts look like or how you add them to an HTML document. That s where this lesson picks up the story. The SCRIPT tag To assist the browser in recognizing lines of code in an HTML document as belonging to a script you surround lines of script code with a SCRIPT . SCRIPT tag set. This is common usage in HTML where start and end tags encapsulate content controlled by that tag whether the tag set be for a form or a bold font. Depending on the browser the SCRIPT tag has a variety of attributes you can set that govern the script. One attribute shared by Navigator and Internet Explorer is the LANGUAGE attribute. This attribute is essential because each browser brand and version accepts a different set of scripting languages. One setting that all scriptable browsers accept is the JavaScript language as in SCRIPT LANGUAGE JavaScript Other possibilities include later versions of JavaScript version numbers are part of the language name Microsoft s JScript variant and the separate VBScript language. You don t need to specify any of these other languages unless your script intends to take specific advantage of a particular language version to the exclusion of all others. Until you learn the differences among the language versions you can safely specify plain JavaScript on all scriptable browsers. In This Chapter Where to place scripts in HTML documents What a JavaScript statement is What makes a script run The difference between scripting and programming 52 Part II JavaScript Tutorial Be sure to include the ending tag for the script. Lines of JavaScript code go between the two tags SCRIPT LANGUAGE JavaScript one or more lines of JavaScript code here .