donglu7816 2012-11-13 08:49
浏览 44

在页面的两个独立部分中的两个iframe内显示页面的一部分

is it possible to display parts of a page inside two separate iframes, where the changes i make in either one of those iframe, will reflect on the other one?

part.html

+-------------+--------------------------------------------------------------------+
|             |                                                                    |
|   part 1    |                                                                    |
|             |                                                                    |
+-------------+                                                                    |  
|                                                                                  |
|                                                                                  |  
+-------------+                                                                    |         |             |                                                                    |
|   part 2    |                                                                    |
|             |                                                                    |
+-------------+                                                                    |             |                                                                                  |
|                                                                                  |
+----------------------------------------------------------------------------------+

frame 1 will load part 1 of part.html

frame 2 will load part 2 of part.html

main.html

+----------------------------------------------------------------------------------+
|                                                                                  |
|                                                                                  |
|  +----------------+                                                              |
|  |                |                                                              |
|  |                |                                                              |
|  |     frame 1    |                                                              |
|  |                |                                                              |
|  |                |                                                              |
|  +----------------+                                                              |
|                                                                                  |
|                                                                                  |
|                                                        +---------------+         |
|                                                        |               |         |
|                                                        |               |         |
|                                                        |     frame 2   |         |
|                                                        |               |         |
|                                                        |               |         |
|                                                        +---------------+         |
+----------------------------------------------------------------------------------+

i want the iframes to still function as one page, as if they are not loaded separately, is there any way to do this?

  • 写回答

2条回答 默认 最新

  • duanlao6573 2012-11-13 09:02
    关注

    There are several ways to achieve this. First you can simple append a parameter in each page call (part.php?part=1 / part.php?part=2) and add some logic inside the part.php file that response with the appropriate content.

    But I'm pretty sure that there are better ways to realize what you try to implement. First you should read this, and understand why there are better ways than using frames:

    http://www.hobo-web.co.uk/website-frames/

    http://www.free2code.net/tutorials/view/replace_frames_with_php_tables-27/page1.html

    (The second example uses tables but you should put your focus on "include")

    Then you should have a look at your structure and maybe find a solution to split up your "part.htm" file. One file for all content can become very unhandy.

    评论

报告相同问题?

悬赏问题

  • ¥15 微信会员卡接入微信支付商户号收款
  • ¥15 如何获取烟草零售终端数据
  • ¥15 数学建模招标中位数问题
  • ¥15 phython路径名过长报错 不知道什么问题
  • ¥15 深度学习中模型转换该怎么实现
  • ¥15 HLs设计手写数字识别程序编译通不过
  • ¥15 Stata外部命令安装问题求帮助!
  • ¥15 从键盘随机输入A-H中的一串字符串,用七段数码管方法进行绘制。提交代码及运行截图。
  • ¥15 TYPCE母转母,插入认方向
  • ¥15 如何用python向钉钉机器人发送可以放大的图片?