【问题标题】:How to organize a home page for my App using iframe?如何使用 iframe 为我的应用组织主页?
【发布时间】:2017-05-19 15:52:17
【问题描述】:

我有一个新项目,我应该在现有系统中实现一个新应用程序。用户将能够通过现有的登录页面访问我的应用程序。一旦他们登录,我将在我的会话变量中获得所有可用信息。根据用户的凭据,我的应用程序的链接可供用户使用。现在我想整理我的主页。我的问题是我应该使用iframe 作为我的主页吗?我应该把其他所有东西都放在iframe 里面吗?我没有使用iframes 的经验,我不确定这是否是最佳选择。这是我所拥有的示例:

<iframe src="Home.cfm" name="homeFrame" id="homeframe" frameborder="0" scrolling="no"></iframe>

这是我的Home.cfm 页面:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=10; IE=11" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Home Page</title>
    <script src="JQuery/jquery-3.2.1.min.js"></script>
</head>
<body>
    <div class="mainpage">

    </div>
</body>
</html>

我还在我的主页上包含了 JQuery。我可能在这个应用程序中还有两个页面。那是包括图书馆的最佳地点吗?还是应该包含在应用程序的每个页面上?

【问题讨论】:

  • 一定要用iframe吗?
  • 我不必使用 iframe。我想知道在笔记本电脑、平板电脑和移动设备上使用和兼容的最佳方式是什么。同时,现在最好和最常用的是什么。谢谢。
  • 做某事的最佳方式通常取决于手头任务的具体要求。
  • 您为什么要考虑 iframe 与登录页面的标准重定向?问的原因是 iframe 有自己的一套怪癖....

标签: javascript html iframe coldfusion coldfusion-9


【解决方案1】:

如果你在首页添加就足够了。试试如下:

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta http-equiv="X-UA-Compatible" content="IE=10; IE=11" />
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>Home Page</title>
    <script src="JQuery/jquery-3.2.1.min.js"></script>
    <script src="default.js"></script>
</head>
<body>
    <div class="mainpage">
    //whatever you have already in this page.Using iframe you can display a separate document, including scrollbars and borders.
    <iframe src="Home.cfm" name="homeFrame" id="homeframe" frameborder="0" scrolling="no"></iframe>
    </div>
</body>
</html>

default.js:

$(function(){
alert('success');
//your stuff
});

【讨论】:

  • 你看起来不像这样? @espresso_coffee
  • 我不确定我是否理解您的回答。您是建议不要使用 iframe 还是?
  • 你可以使用iframe。我更新了答案。请看@espresso_coffee
  • 我应该在正文中使用 iframe 还是应该在整个页面内容周围扭曲 iframe?
  • 你也可以使用内部的iframe,你可以调整宽度和高度
猜你喜欢
  • 2010-09-05
  • 1970-01-01
  • 1970-01-01
  • 2016-03-26
  • 1970-01-01
  • 1970-01-01
  • 2011-10-28
  • 2018-11-25
  • 1970-01-01
相关资源
最近更新 更多