簡體   English   中英

使用自動刷新將DIV代碼更改為iframe

[英]Change DIV tag to Iframe with AutoRefresh

我沒有編碼知識,我有div代碼,並且其中一個Flash文件包含一些內容。 我想使內容每30秒刷新一次。

請在內容代碼中添加自動刷新

        <!-- BEGIN:PAGE -->
    <div id="page">
        <div id="pictureAndLinks">
            <a href="$song.buycd$" target="_blank"><img class="picture" id="picture" onload="showPicture(this, true)" src="$song.picture$" alt="Buy CD!" border=0 /></a>
        </div>

        <h1>Track Information</h1>

        <dl>
            <dt>Title</dt>
                <dd>$song.title$</dd>
            <dt>Artist</dt>
                <dd>$song.artist$</a></dd>
            <dt>Album</dt>
                <dd>$song.album$</a></dd>
            <dt>Duration</dt>
                <dd>$song.mmss$</dd>
            <dt>Year</dt>
                <dd>$song.albumyear$</dd>
            <dt>Genre</dt>
                <dd>$song.genre$</dd>
            <dt>Lyrics</dt>
                <dd class="broad"><pre>$song.lyrics$</pre></dd>
            <dt>Information</dt>
                <dd class="broad">$song.info$</dd>
        </dl>
        <div class="spacer"></div>

請不要添加PHP文件。 因為此文件在相同的位置和相同的文件名上工作。 我嘗試用load.php文件無法正常工作。

我認為iframe正在為此工作。 我不知道要將其更改為iframe,請有人將其更改為iframe,並自動刷新30秒。

謝謝

這應該工作。 將其添加到文件頂部,站點將每30秒刷新一次。

<script type="text/javascript">
    window.onload = setupRefresh;

    function setupRefresh() {
        setTimeout("refreshPage();", 30000);
    }
    function refreshPage() {
        window.location = location.href;
    }
</script>

添加head標簽

<meta http-equiv="refresh" content="30">

http://www.w3schools.com/tags/att_meta_http_equiv.asp

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM