简体   繁体   中英

Customized twitter button with pop-up

This is the code for my Twitter button that works:

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>')

I've a simple question.

I would like to open the link as a pop-up dialog and not in a new page and that when I click on "OK" to confirm the tweet of the link, it returns in my application.

Can you help me ?

Thank you

It is hard to tell exactly what you are trying to do without more code, but the javascript version of the pop-up is below.

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

This is some javascript code for a confirmation message.

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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