Wrox Home  
Search P2P Archive for: Go

  Return to Index  

javascript_howto thread: javascript to open an iframe


Message #1 by "Paulette Parent" <darwin33@e...> on Tue, 16 Oct 2001 00:50:39
I currently have some ASP code that might help you.  I use an <IFRAME> on 
one of my sites.  I've added comments (beware of lines that have wrapped) 
to help explain the process.

Hope this is helpful.

FOR MAIN.ASP MY CODE IS AS FOLLOWS:
<%if session("steps")="" then session("steps")="Step1.asp"%>  //'session' 
is a variable used in the other pages.  If 'session' happens to be blank 
("") then it is set to "step1.asp".  This prevents errors related to 
missing pages. 
<html>
<head>
<title>Office of Investigations -- I.M.P. Process Plan Main Page</title>
</head>

<BODY >
<iframe src="<%response.write(session("steps"))%>" name="body" 
width="100%" height="125%" title="Body"></iframe>
</BODY>

FOR THE OTHER PAGES THE CODES LOOKS LIKE THIS:
<%
if session("steps") =""  then   //If 'session' has not previously been 
assigned for this page, then
        session("steps")="Step7.asp"    //sets the 'session' variable
        response.redirect "IMP_Steps.asp"       //redirects the content of 
'session' to IMP_Steps.asp
end if
session("steps")="Step7.asp"
%>
<html>
<head>
<title>Step 7</title>
</head>

<body bgcolor="#FFFFFF" text="#000000">
Stuff goes here. Stuff goes here. Stuff goes here. Stuff goes here.  This 
stuff actually appears within the <iframe> of MAIN.ASP.
</body>
</html>

================================
I am trying to get some JavaScript that will open an iframe in my html 
page.  The page that is opened in the frame needs to depend on the season 
(ie. summer.htm, fall.htm, winter.htm, spring.htm) My frame is in place 
and I can open up the different pages in it manually but I want 
JavaScript to automate the process. 

Thank for any help!


  Return to Index