[英]Is it possible to make Iframe alternate?
我的問題:我可以使用iframe顯示包括(圖像背景)在內的php文件的內容。 當我去包括我的PHP文件使用
include("modules/form.php");
or
file_get_contents("modules/form.php");
它顯示內容,但是背景圖像變得不可見。 這是一個很大的網站。 那么,為此目的是否還有其他iframe? 我不想使用iframe,因為我在Google中的排名正在下降。
到目前為止,您無法使用php進行存檔。 PHP是服務器端腳本,它對客戶端一無所知。 您可以使用jquery,首先必須創建一個div並在其中設置頁面的內容。使用下面的代碼
<head>
<script type='text/javascript' src='http://ajax.googleapis.com/ajax/libs/jquery/1.4/jquery.min.js?ver=1.4'></script>
<script type='text/javascript'>
$(document).ready(function (){
$('#divId').load(full url to modules/form.php); // Paste the full url here
});
</script>
</head>
<body>
<div id="divId"></div>
</body>
</html>
希望這對您有幫助
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.