发布后从iframe重定向到wall
Redirect after publish to wall from iframe
我想知道是否有可能在使用发布到墙弹出对话框后将某人重定向到不同的标签url。
当前发布到墙脚本。
<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: APPID,
status: true,
cookie: true,
xfbml: true}); };
(function() {
var e = document.createElement('script');
e.async = true;
e.src = document.location.protocol +
'//connect.facebook.net/en_US/all.js';
document.getElementById('fb-root').appendChild(e);
}());
</script>
<script>
function publish_to_wall(){
FB.ui({
method: 'stream.publish',
display: 'iframe',
name: ('some text ') + (document.getElementById('myText').value) +(' some text'),
caption: 'some caption',
link: 'some url',
picture:'some image url'
});
}
</script>
重定向必须发生在iframe内,所以当有人在他/她的墙中发布文章后,人们会被重定向到一个感谢页面。
像这样?
feedData = {};
feedData.method = 'feed';
feedData.name = "title";
feedData.link = "url";
feedData.picture = "url to picture";
FB.ui(feedData,function(feedResponse) {
if (response && response.post_id) {
alert('Post was published.');
//do redirect
window.location = "url to thank you page"
} else {
alert('Post was not published.');
}
});
相关文章:
- 通过javascript重定向html传递php变量
- JavaScript下拉菜单-点击按钮并根据所选值重定向到url
- 使用angular重定向到html页面
- 如何在chrome扩展中重定向到html页面
- 无法从jquery Mobile导航栏重定向到另一个页面
- ng视图外的链接重定向到ng视图内的页面
- 在phonegap应用程序内部重定向不起作用
- CORS-重定向到第二个GET正在接收的页面
- AJAX不会在文件上传后重定向到网页-POST方法
- 重定向时角度刷新浏览器
- 通过链接重定向不;我不在jstree中工作
- 根据select选项元素将表单重定向到不同的URL
- 通过JQuery重定向到另一个页面
- 重定向到“父窗口”
- 重定向iFrame中的父URL
- PHP-如何重定向到同一页面并更改DOM's
- chrome.tabs.update() 重定向到 'chrome-extension://invalid/'
- 我们如何在不更改url的情况下使用锚点点击从一个页面重定向到另一个页面
- 使用AngularJS中的UI路由器将状态重定向到默认子状态
- 发布后从iframe重定向到wall