javascript,在画布中重定向

时间:2013-07-22 16:28:43

标签: javascript facebook canvas

我对javascript和网络编程很新。但基本上,我已经制作了一个Facebook画布应用程序,我想知道如何重定向到一个页面,并使用javascript使其保持在iframe内。例如:现在我有类似

的东西
<script type="text/javascript">
      window.parent.location = "http://www.google.com";
  </script>

但是这会重定向到不在画布应用程序内的Google页面......有什么想法吗?

谢谢!

1 个答案:

答案 0 :(得分:0)

在Facebook中,重定向选项被禁用。因此,除非被用户点击,否则无法重定向到任何uri。 重定向是自动的,点击是手动的。

11. The primary purpose of your Canvas or Page Tab app on Facebook must not be to simply redirect users out of the Facebook experience and onto an external site.


2.You must not pre-fill any of the fields associated with the following products, unless the user manually generated the content earlier in the workflow: Stream stories (user_message parameter for Facebook.streamPublish and FB.Connect.streamPublish, and message parameter for stream.publish), Photos (caption), Videos (description), Notes (title and content), Links (comment), and Jabber/XMPP.

https://developers.facebook.com/policy/