Using IFrames in the CML

An IFrame is an HTML element that allows a document to contain other documents within the flow of the page, as opposed to within a frameset. The Library.asp file embeds two IFrames, called ifRequest and ifControl, as shown in the following code:

<script LANGUAGE=VBScript>
Dim screenWidth,screenHeight,x
screenWidth = CInt(screen.availWidth * 0.65)
screenHeight = CInt(screen.availHeight * 0.65)
x = "<iframe ID=""ifRequest"" STYLE=""display:none;POSITION:absolute;top:113;left:265;height:" & screenHeight & " px;width:" & screenWidth & " px"" FRAMEBORDER=0 NORESIZE SCROLLING=NONE></iframe>"
document.write x
</script>

<!-- This child window controls the parent -->
<% ' ASP Session object retains the current location, so that refresh doesn't restart us from the beginning. %>
<iframe ID="ifControl" STYLE="display:none;top:0;left:250;height:40 px;width:540 px;POSITION:absolute" FRAMEBORDER=0 NORESIZE SCROLLING=NONE SRC="<%= Session("LastPage") %>"></iframe>

The first IFrame, ifRequest, is used to display data. The second, ifControl, is hidden except when made visible with the following debug setting in Library.asp:

Application("Debug") = True

By default, the ifControl IFrame is not visible, as specified in this part of its definition:

STYLE=""display:none;

The CML typically uses IFrames not for display but for threads of communication between the client and the Web server, in particular for communication with RDS controls. For example, Library.asp and the files it includes let library users request information on library items, such as a list of all books by a certain author. It is Dfilter.asp (included in Library.asp) that actually presents menu choices for entering a text string and filtering the search by title, author, or subject. See About Dfilter.asp.