Skip to content Skip to sidebar Skip to footer

Referencing Another Page And Change The Iframe Content

I am trying to use my Home Page to reference another page and change the content in the iframe of that page and its title using JavaScript. I can change the content when I already

Solution 1:

Move the iframe to the home page and remove the Entry.html page completely. That page seems worthless considering what you are trying to do. Then remove the anchor tags from the Waste, Metrics, and Safety links. Here is the updated home.html:

<divid="body"><br></div><divid="header"><h1>Carrolton Plant</h1><divid="headerIcon"></div><divid="tv1clock"></div></div><divid="content"><center><divid="wrapper"><divid="iFrameHeight"><iframename="iframe"src="MetricsEntryForm.html"scrolling="auto"id="GlobalFrame"></iframe></div></div></center></div><spanid="oeeLine1GaugeContainer"></span><spanid="oeeLine2GaugeContainer"></span><spanid="oeePlantGaugeContainer"></span><spanid="testGaugeContainer"></span><divid="footer">&nbsp;<inputtitle="Home Page"type="homebutton"></input><inputtitle="Previous Page"type="previousbutton"onclick="PreviousPage()"></input><inputtitle="Waste Entry Page"type="wastebutton"onclick="WastePage()"></input><inputtitle="Metrics Initializer"type="gearbutton"onclick="MetricsPage()"></input><ahref="HeatMap.html"><inputtitle="Heat Map"type="heatbutton"></input></a><inputtitle="Safety Entry"type="safetybutton"onclick="SafetyEntryPage()"></input><inputtitle="Trending"type="trendbutton"onclick="Trending()"></input><inputtitle="Alarm and Events"type="alarmbutton"onclick="Alarm()"></input><inputtitle="Report Expert"type="expertbutton"onclick="ReportExpert()"></input><inputtitle="Data Entry Reports"type="ssrsbutton"onclick="DataEntrSSRS()"></input></div>

Also add this function to your javascript file

functionHomePage() {
    document.getElementById("h1").innerHTML = "Carrolton Plant";
    document.getElementById("GlobalFrame").src = "MetricsEntryForm.html";
}

That is what I would do anyways.

Post a Comment for "Referencing Another Page And Change The Iframe Content"