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 "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<BASE TARGET = "Main">
<SCRIPT LANGUAGE="VBScript">
Sub SectionOne()
Parent.frames("Main".location.href= "Report.Part 1.html"
End Sub
Sub SectionTwo()
Parent.frames("Main".location.href= "Report.Part 2_1.html"
End Sub
Sub SectionThree()
Parent.frames("Main".location.href= "Report.Part 3_1.html"
End Sub
Sub SectionFour()
Parent.frames("Main".location.href= "Report.Part 5_1.html"
End Sub
Sub SectionFeas()
Parent.frames("Main".location.href= "Report.Feas.html"
End Sub
</SCRIPT>
</head>
<body>
<H2 >Score Report Sections</H2><BR><BR>
<BR><A HREF = VBScript: onclick="SectionOne">Overall Performance</A><BR>
<BR><A HREF = VBScript: onclick ="SectionTwo" >Job Function Performance</A><BR>
<BR><A HREF VBScript: onclick ="SectionThree" >Performance Within Job Functions</A><BR>
<BR><A HREF = VBScript: onclick ="SectionFour" >Reported Performance Distributions</A><BR>
<BR><A HREF = VBScript: onclick =" SectionFeas">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
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 "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>Untitled</title>
<BASE TARGET = "Main">
<SCRIPT LANGUAGE="VBScript">
Sub SectionOne()
Parent.frames("Main".location.href= "Report.Part 1.html"
End Sub
Sub SectionTwo()
Parent.frames("Main".location.href= "Report.Part 2_1.html"
End Sub
Sub SectionThree()
Parent.frames("Main".location.href= "Report.Part 3_1.html"
End Sub
Sub SectionFour()
Parent.frames("Main".location.href= "Report.Part 5_1.html"
End Sub
Sub SectionFeas()
Parent.frames("Main".location.href= "Report.Feas.html"
End Sub
</SCRIPT>
</head>
<body>
<H2 >Score Report Sections</H2><BR><BR>
<BR><A HREF = VBScript: onclick="SectionOne">Overall Performance</A><BR>
<BR><A HREF = VBScript: onclick ="SectionTwo" >Job Function Performance</A><BR>
<BR><A HREF VBScript: onclick ="SectionThree" >Performance Within Job Functions</A><BR>
<BR><A HREF = VBScript: onclick ="SectionFour" >Reported Performance Distributions</A><BR>
<BR><A HREF = VBScript: onclick =" SectionFeas">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