首页 > 解决方案 > 在 iFrame 中加载服务器端而不是 URL

问题描述

是否有可能iframe来自服务器的源文件而不是URL含义而不是

   ---> Instead of
<iframe width='100%' height='100%' src='http://example.com/file.php' allowTransparency='yes' frameborder='no' scrolling='no' id='adminheader' > </iframe>

   ---> Load Server Side File
    
    <iframe width='100%' height='100%' src='/home/username/public_html/header.php' allowTransparency='yes' frameborder='no' scrolling='no' id='adminheader' > </iframe>

目的是仅按原样加载标题,并在可能的情况下间接应用某些样式和脚本来访问它。

标签: phpiframeserver-sidepublic-html

解决方案


不,因为 iframe 是在客户端呈现的。但我不明白为什么你不能用 URL 加载它们。

<iframe src='http://example.com/header.php'>

推荐阅读