标签: iframe-app

Facebook,iframe app,fb:请求表单,动作属性问题

我正在制作facebook iframe应用程序

我正在使用自己的表单数据创建一个请求表单.我该怎么做才能处理数据?

如果我把action ="http://apps.facebook.com/ [appName]/abc.php",即

<fb:serverfbml>
    <script type="text/fbml">
        <fb:fbml>
            <fb:request-form action="http://apps.facebook.com/[appName]/abc.php" method="post" type="abc" content="abc">
                <textarea name="pm" fb_protected="true" ></textarea>
                <fb:multi-friend-selector showborder="false" max="35" actiontext="test" email_invite="true" bypass="cancel" />
            </fb:request-form> 
        </fb:fbml>
    </script>
</fb:serverfbml>
Run Code Online (Sandbox Code Playgroud)

然后结果很有趣... facebook app的iframe里面的facebook页面!

但如果我把动作="http:// [我自己的域名/脸书连接网址] /abc.php",即

<fb:serverfbml>
    <script type="text/fbml">
        <fb:fbml>
            <fb:request-form action="http://[my own domain / facebook connect url]/abc.php" method="post" type="abc" content="abc">
                <textarea name="pm" fb_protected="true" ></textarea>
                <fb:multi-friend-selector showborder="false" max="35" actiontext="test" email_invite="true" bypass="cancel" />
            </fb:request-form> 
        </fb:fbml>
    </script>
</fb:serverfbml>
Run Code Online (Sandbox Code Playgroud)

然后结果页面将呈现WITHOUT facebook模板(这意味着丢失所有顶级Facebook横幅和底部Facebook栏,如Facebook聊天等)

谁知道什么是错的?

非常感谢阅读

facebook serverfbml fbrequest-form iframe-app

6
推荐指数
2
解决办法
2万
查看次数

从facebook iframe获取父页面html内容?

在这里我正在使用facebook应用程序.

我创建了在facebook iframe窗口中工作的页面.

我想从我创建的iframe访问main(父)窗口html源代码.

我在这里尝试过

parent.documentwindow.top.document以及window.parent

这三个都不适合我的情况.如果您有任何其他想法,请告诉我,

谢谢

iframe facebook facebook-iframe iframe-app

5
推荐指数
1
解决办法
664
查看次数

如何从 IFRAME 中触发“beforeunload”事件

我有一个应用程序(命名为 B),它被另一个主应用程序(命名为 A 或父应用程序)嵌入到 Iframe 中。

So: App A--                     // domain of A: https://mydomain/mainApp
           |___ App B in Iframe // domain in B: https://mydomain/appB
Run Code Online (Sandbox Code Playgroud)

问题是:然后主/父应用程序有一个导航菜单。一个项目,当点击时,创建一个带有 SRC 属性的 Iframe,里面加载了 App B。

当用户点击应用 A 中菜单的另一个选项时,Iframe 被销毁,React 中出现另一个内容视图,替换 Iframe。

这样做时,用户在 B 中的表单中键入的所有数据都消失了,因为我无法触发 B 中的保存事件。

我在 iframe 应用程序中添加了以下事件处理程序:

window.addEventListener("beforeunload", function (e) {

    // Trigger here the save settigns event inside B
});
Run Code Online (Sandbox Code Playgroud)

但是当用户浏览主应用程序菜单时,以前的代码永远不会触发。正如我所看到的,App A 中的导航菜单会更改浏览器中的 URL(但似乎是 SPA React.js 路由或类似路由,没有真正的重定向)。

问题是:Iframe 能否检测到何时卸载/销毁以首先触发 Ajax 中的保存设置?PS:我无权访问 App A 代码。

提前致谢

javascript iframe iframe-app dom-events reactjs

5
推荐指数
1
解决办法
9596
查看次数

beforeunload 事件之前的 Angular8 IFrame

我有一个 angular 应用程序,它是在其中托管子应用程序的主应用程序。子应用程序也是角度应用程序。我加载子应用程序的方式是通过 Iframes。

子应用程序显示为一个列表,当我单击一个选项卡时,该应用程序被加载。当我对应用程序中的数据进行一些更改时,如果我单击另一个子选项卡,我想显示一条警告消息,指出“更改将丢失”。我可以通过使用 beforeunload 事件来实现它,如下所示。我可以检查是否有任何未保存的更改并显示警告弹出窗口。

  @HostListener('window:beforeunload', ['$event'])
  unloadNotification($event: any) {
      if (**my logic here) {
          $event.returnValue =true;
      }
  }
Run Code Online (Sandbox Code Playgroud)

唯一的问题是,当我单击另一个子选项卡时,主机应用程序会突出显示该子选项卡,然后显示警告弹出窗口。如果我单击弹出窗口上的停留按钮,我可以在我想要的子选项卡上,但在主机应用程序上,另一个子选项卡会突出显示。因此,如果我想留在当前子选项卡上,我正在尝试寻找一种不突出显示其他选项卡的方法。在卸载之前的东西。

javascript iframe onbeforeunload iframe-app angular

4
推荐指数
1
解决办法
512
查看次数