php頁面顯示內容後延時跳轉

來源:互聯網
上載者:User
想做一個頁面,傳一個url進來,先把頁面本身的內容顯示出來,然後幾秒後跳轉到url。
例如:下載頁面,放些廣告,然後跳轉。
網站好多雖然可以跳轉,可是顯示不出內容,求大神


回複討論(解決方案)

HTTP 頭中有延時跳轉的指令
如 header("Refresh:5;url=index.php");
將在 5 秒鐘後轉到 index.php

HTTP 頭中有延時跳轉的指令
如 header("Refresh:5;url=index.php");
將在 5 秒鐘後轉到 index.php
不是我要的效果,我要的是在跳轉前可以把本頁面內容顯示出來,請寫個整體的代碼看看嘍,謝謝

$(document).ready(function(){
setTimeout(function(){location.href="bbb.html";},5000);
});

  • 聯繫我們

    該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

    如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

    A Free Trial That Lets You Build Big!

    Start building with 50+ products and up to 12 months usage for Elastic Compute Service

    • Sales Support

      1 on 1 presale consultation

    • After-Sales Support

      24/7 Technical Support 6 Free Tickets per Quarter Faster Response

    • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.