gpt4 book ai didi

php - 为什么 iframe 内容为空?

转载 作者:行者123 更新时间:2023-12-02 20:48:30 24 4
gpt4 key购买 nike

我试图理解这段代码:

在display.php中:

<html>
...
<body>
<table>
<tr>
<td>
User info: <iframe id="SpControlFrame1" name="SpControlFrame1" src="javascript:'';"path_src="index.php?cmd=YYY" ></iframe>
</td>
</tr>
</table>
</body>
</html>

在另一个文件中,我有一个 switch 语句:

main.php

switch ("cmd") {
case ZZZ:
include("foo.php");
break;
case YYY:
include("blah.php")
break;
}

blah.php:

<?php
//some functions for processing
?>
<html>
<head>
...
</head>
<body>
<input type="text" size="12" name="username">
<input type="button" value="submit">
</body>
</html>

1)那么,有人可以解释一下这里发生了什么吗? iframe 嵌入在页面中,不会导致重新加载或类似的情况。

2) 我试图在另一个页面上复制此功能,但 iframe 始终为空(我已使用 IE 开发人员工具栏验证了这一点)

最佳答案

如果没有看到相关代码,我无法真正说出发生了什么。您的示例假定相关代码是服务器端的,并且当满足特定变量/条件时,iframe 将由 blah.php 创建或填充。

您必须确保在创建另一个 iframe 时调用相同的代码。也许您可以扩展相关代码?原始源和新源(不是 iframe,而是包含的文档)。

关于php - 为什么 iframe 内容为空?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/429510/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com