WordPress.org

Ready to get started?Download WordPress

Forums

Iframe content does not refresh after iframe html is edited (1 post)

  1. aashishbhargav
    Member
    Posted 1 year ago #

    Situation in hand:
    I have an Iframe hosted on my website http://modgadgets.com
    Its called framed.htm and I update it by changing the HTML of this framed.htm file and replace the new file with old framed.htm file on the hosting server.

    Behavior:
    The framed.htm shows old content unless I clear cache of browser (tried in safari, IE9, firefox, chrome, windows OS, Mac OS)
    Or I get the new content if
    I open the path where the framed.htm is stored on the server and hit refresh. Then go back to main site and hit refresh.
    In my case the path is
    http://modgadgets.com/wp-content/uploads/frames/sitetop/framed.htm

    What should happen:
    Each time the framed.htm is changed and uploaded, the new framed.htm should show on the home page without having to clean the cache or opening the framed.htm path as my readers will not do it on their computers.

    This issue is specific to wordpress. I tested by hosting htm files outside wordpress and new content shows up only by refreshing

    I have this code added to the head of the iframe hoping that this would refresh the content on home page load but its not working.

    <script type="text/javascript"> iframe.onload = function() {this.contentWindow.location.reload(); this.onload = null;};</script>

Topic Closed

This topic has been closed to new replies.

About this Topic