tailieunhanh - Học JavaScript qua ví dụ part 67
DHTML là gì? DHTML là viết tắt của Dynamic HTML. Nó không phải là một ngôn ngữ lập trình, nhưng một kỹ thuật được sử dụng khi HTML / XHTML, CSS, và JavaScript (và Ajax) làm việc với nhau để tạo lên một trang web tương tác năng động. | Where Does JavaScript Fit In 585 Where Does JavaScript Fit In What Is DHTML DHTML stands for Dynamic HTML. It is not a programming language but a technique used when HTML XHTML CSS and JavaScript and Ajax work together to make up a dynamic interactive Web page. With CSS we were able to control the style . color font margins etc. of the HTML elements and store the style sheets in separate files. All by itself CSS is presenting a style for your page but now we need JavaScript to bring the Web page to life to make it dynamic. Throughout this text we have been using event handlers and functions with JavaScript to create rollovers slideshows animation submit forms and so on. In the next chapter we discuss how to access every element on a Web page with the DOM. Then you can apply CSS styles and JavaScript to the DOM elements to create what will effectively make it possible to manipulate create and delete any part of your page on the fly. How JavaScript Views Style Sheets Sometimes a page consists of more that one style sheet. When the page is loaded all external and embedded style sheets are stored in an array in the order in which they are placed within the document just as are images forms and links. The array is called styleSheets a property of the document object so 0 is the first style sheet normally the general style sheet for the entire page. The next style sheet maybe one that uses the @import rule would be 1 and if you embedded another style within the document that would be 2 . Because each of the elements of the styleSheets array has a disabled property that can be turned on and off you can dynamically toggle between styles allowing a user to select a style suited to his or her own taste. It is also possible to access a specific rule within a style sheet by using the W3C cssRules array or the Microsoft rules array. Both arrays work with index numbers. The first rule .
đang nạp các trang xem trước