繁体   English   中英

带有弹出窗口的自定义Twitter按钮

[英]Customized twitter button with pop-up

这是我的Twitter按钮有效的代码:

var tweeturl = 'http://twitter.com/share?url=' + encodeURI(window.location) +'&via=MyTwitterUserName&text=The editable text I want to include automatically in the tweet';

// Place the text on the page. Change body to wherever you want the button placed. 
$('div[data-role="footer"] > div').append('<a id="mycustomtwitterbutton" href=" ' + tweeturl + ' "><img src="/Content/images/share_twitter.jpg"></a>')

我有一个简单的问题。

我想将链接作为弹出对话框而不是在新页面中打开,并且当我单击“确定”以确认链接的推文时,它会在我的应用程序中返回。

你能帮助我吗 ?

谢谢

很难确切地知道没有更多代码您想做什么,但是弹出窗口的javascript版本如下。

var actwin=window.open(location,'mywindow',
'width=706,height=630,status=no,location=no,menubar=no,scrollbars=no,resizable=yes');
actwin.focus();

这是一条用于确认消息的JavaScript代码。

var x=window.confirm("Question?");
if (x){
 ///code
}
else{}

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM