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:

  <div id="body"><br></div>
  <div id="header">
     <h1>Carrolton Plant</h1>       
     <div id="headerIcon"></div>
     <div id="tv1clock"></div>
  </div>      
  <div id="content">
    <center>
      <div id="wrapper">        
        <div id="iFrameHeight">
           <iframe name="iframe" src="MetricsEntryForm.html" scrolling="auto" id="GlobalFrame"></iframe>
        </div>         
      </div>
    </center>
   </div>
    <span id="oeeLine1GaugeContainer"></span>
    <span id="oeeLine2GaugeContainer"></span>
    <span id="oeePlantGaugeContainer"></span>
    <span id="testGaugeContainer"></span>

  <div id="footer">&nbsp;
     <input title="Home Page" type="homebutton"></input>
     <input title="Previous Page" type="previousbutton" onclick="PreviousPage()"></input>
   <input title="Waste Entry Page" type="wastebutton" onclick="WastePage()"></input>
     <input title="Metrics Initializer" type="gearbutton" onclick="MetricsPage()"></input>
     <a href="HeatMap.html"><input title="Heat Map" type="heatbutton"></input></a>
    <input title="Safety Entry" type="safetybutton" onclick="SafetyEntryPage()"></input>
     <input title="Trending" type="trendbutton" onclick="Trending()"></input>
     <input title="Alarm and Events" type="alarmbutton" onclick="Alarm()"></input>
     <input title="Report Expert" type="expertbutton" onclick="ReportExpert()"></input>
     <input title="Data Entry Reports" type="ssrsbutton" onclick="DataEntrSSRS()"></input>   
  </div>

Also add this function to your javascript file

function HomePage() {
    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"