Đang chuẩn bị liên kết để tải về tài liệu:
DHTML Utopia Modern Web Design Using JavaScript & DOM- P12

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

DHTML Utopia Modern Web Design Using JavaScript & DOM- P12:In a single decade, the Web has evolved from a simple method of delivering technical documents to an essential part of daily life, making and breaking relationships and fortunes along the way. “Looking something up on the Internet,” by which is almost always meant the Web, is now within reach of almost anyone living in a first-world country, and the idea of conducting conversations and business (and probably orchestras) in your Web browser is no longer foreign, but part of life | Chapter 8 Remote Scripting style head body h1 A simple iframe h1 p Below is an iframe styled in size with CSS and displaying a different document. p iframe id myframe src simple-iframe-content.html iframe body html The HTML document displayed by the iframe is trivial and unstyled File simple-iframe-content.html DOCTYPE HTML PUBLIC - W3C DTD HTML 4.01 EN http www.w3.org TR html4 strict.dtd html body p This is a document em in em the iframe. p body html Figure 8.1 shows the page display Figure 8.1. The document with an iframe that displays another document. A simple iframe Below is an frame styled in size with CSS and displaying a different document. This is a document in the frame. 200 Licensed to siowchen@darke.biz Using iframe There s no sign that the iframe document is separate from that which surrounds it. Replacing iframes You can change the document that displays inside the iframe using a script located in the surrounding document. If the iframe is styled so as not to draw attention to itself this technique creates the illusion that part of the parent document has changed. The iframe element s src attribute is like other attributes on HTML elements available as a property of the corresponding DOM object. Here s a simple script that can be called from a button press or link click it merely changes the document displayed in the iframe script type text javascript function changeIFrame document.getElementById myframe .src http www.google.com script This example is so simple it doesn t even need JavaScript. iframes act like normal frames and can therefore be the target of any hyperlink. You can display a link s destination in an iframe by setting the target attribute on the link to the name of the iframe. Retrieving Data with iframes With further scripting it s possible for the iframe s newly-loaded page to pass data back to its parent page. Scripts in the iframe content page can call functions in the parent page by referring to those parent-page functions as .