document.lastmodified of document through iframe.

Posted on 2007-10-08
Last Modified: 2012-06-27
I have an html page called main.html that displays different html tables which I'll call (standard.htm, nonstandard.htm, substandard.htm) through an iframe.

I want to write a last updated date that is at the top of main.html but show the last document.lastmodified of standard.htm
Question by:mcgilljd
    1 Comment
    LVL 20

    Accepted Solution

    <script type="text/javascript">
    function getLastMod(){
    var myFrm = document.getElementById('myIframe');
    var lastModif = new Date(myFrm.contentWindow.document.lastModified);
    document.getElementById('LastModified').innerHTML = "Modified at: " + lastModif.toLocaleString();
    <span id="LastModified"></span>

    <iframe id="myIframe" onload="getLastMod()" src="standard.htm" style="display:none;">


    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    IT, Stop Being Called Into Every Meeting

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Suggested Solutions

    This article discusses the difference between strict equality operator and equality operator in JavaScript. The Need: Because JavaScript performs an implicit type conversion when performing comparisons, we have to take this into account when wri…
    Not sure what the best email signature size is? Are you worried about email signature image size? Follow this best practice guide.
    The viewer will learn how to count occurrences of each item in an array.
    The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

    758 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    8 Experts available now in Live!

    Get 1:1 Help Now