Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Changing frame content won't work!?

Status
Not open for further replies.

Orgdoctor

Technical User
Jan 8, 2003
13
US
I'm an experienced programmer but new to VBScript. I've spent two days on this puzzle and finally have to admit I'm at a loss. Would someone be so kind as to tell me what I'm doing wrong?

In a separate HTML file I set up a page with two frames: Navigator and Main. Then, in the page below I try to change the content of the Main frame by clicking on the content links in the Navigator frame. Rather than just use an anchor to make the change, I have each anchor call a VBScript Sub to make the change. I'm doing this because I want to add other code to the Subs later to alter the pages called before I display them. Here is the code that won't work:

<!DOCTYPE HTML PUBLIC &quot;-//W3C//DTD HTML 4.01 Transitional//EN&quot;>

<html>
<head>
<title>Untitled</title>
<BASE TARGET = &quot;Main&quot;>

<SCRIPT LANGUAGE=&quot;VBScript&quot;>

Sub SectionOne()
Parent.frames(&quot;Main&quot;).location.href= &quot;Report.Part 1.html&quot;
End Sub

Sub SectionTwo()
Parent.frames(&quot;Main&quot;).location.href= &quot;Report.Part 2_1.html&quot;
End Sub

Sub SectionThree()
Parent.frames(&quot;Main&quot;).location.href= &quot;Report.Part 3_1.html&quot;

End Sub

Sub SectionFour()
Parent.frames(&quot;Main&quot;).location.href= &quot;Report.Part 5_1.html&quot;

End Sub

Sub SectionFeas()
Parent.frames(&quot;Main&quot;).location.href= &quot;Report.Feas.html&quot;

End Sub

</SCRIPT>

</head>

<body>

<H2 >Score Report Sections</H2><BR><BR>
<BR><A HREF = VBScript: onclick=&quot;SectionOne&quot;>Overall Performance</A><BR>
<BR><A HREF = VBScript: onclick =&quot;SectionTwo&quot; >Job Function Performance</A><BR>
<BR><A HREF VBScript: onclick =&quot;SectionThree&quot; >Performance Within Job Functions</A><BR>
<BR><A HREF = VBScript: onclick =&quot;SectionFour&quot; >Reported Performance Distributions</A><BR>
<BR><A HREF = VBScript: onclick =&quot; SectionFeas&quot;>Position Feasibility Analysis</A><BR>

</body>

</html>

When I run this (in IE6) I get a progress bar indicating something is loading when I click on the links in the navigation frame, but nothing changes in the Main frame. I know the call is reaching the Subs because I've tested them with Msgboxes substituted for the page calls.

Show off your stuff, guys. If you can solve this one after it completely defeated me, I will be really impressed and grateful.

Jeff Kane
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top