How can we open the Facebook
window in new Tab
instead of opening in new window
?
<div style="position: relative; top: 3px;" id="likeButton">
<iframe frameborder="0" scrolling="no" allowtransparency="true" style="border: none;
overflow: hidden; width: 260px; height: 35px;" src="http://www.facebook.com/plugins/like.php?href=http:\\localhost\login.aspx|@&send=false&layout=button_count&width=100&
show_faces=false&action=like&colorscheme=light&font=arial&height=35">
</iframe>
</div>
Issue is - On clicking the Like Button
, opens the Facebook
login window in new Window. How can I open it in new Tab
My JSFiddle is here
Try this code, its working for me.
<a style="position: absolute; top:0px; left: 0px; width:100px; height:40px; cursor:pointer;" href="https://www.facebook.com/login.php?skip_api_login=1&display=popup&social_plugin=like&external_page_url=http%3A%2F%2Finvalid.invalid%2F&next=http%3A%2F%2Fwww.facebook.com%2Fconnect%2Fuiserver.php%3Fmethod%3Dopt.inlike%26app_id%3D127760087237610%26display%3Dpopup%26social_plugin%3Dlike%26secure%3Dfalse%26protocol%3Dhttp%253A%26external_page_url%3Dhttp%253A%252F%252Finvalid.invalid%252F%26from_login%3D1%26client_id%3D127760087237610&rcount=1" target="_blank"></a>
<div style="position: ansolute; top: 0px;z-index:0; cursor:pointer;" id="likeButton">
<iframe frameborder="0" scrolling="no" allowtransparency="true" style="border: none; overflow: hidden; width: 260px; height: 35px;z-index: 0;" src="http://www.facebook.com/plugins/like.php?href=http:\\localhost\login.aspx|@&send=false&layout=button_count&width=100& show_faces=false&action=like&colorscheme=light&font=arial&height=35"></iframe>
</div>
Working example : http://jsfiddle.net/JpWCf/
Change the external_page_url parameter from href.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With