Search code examples
javascriptasp.nethref

When I click link new Page isn't opened on the small tab


 <a href="#" id="signinFace" >Sign in With Facebook</a>
                <script type="text/javascript">
                    $(document).ready(function () {
                      $("#signinFace").click(function () {
                            $(this).attr('href', 'https://www.facebook.com/dialog/oauth/?client_id=' +
                            '5649219384156&' +
                            'redirect_uri=http%3A%2F%2Flocalhost%3A4151%2FMainPage.aspx&' +
                            'response_type=code&' +
                            'scope=email,user_birthday,user_location&' +
                            'display=popup')    
                        });
                    });

What Should I do When I click Sign in With Facebook , new page would be opened on a new and small tab ? I thought hat display=popup is enough for this. But It is opened on the same window. I also tried <a href="#" id="signinFace" target="_blank" ></a> , but nothinhg changed.


Solution

  • Try this code:

     <a href="#" id="signinFace" >Sign in With Facebook</a>
                    <script type="text/javascript">
                        $(document).ready(function () {
                          $("#signinFace").click(function (e) {
                                event.preventDefault();
    window.open("Your URL HERE",windowName,'height=200,width=150');
                            });
                        });
    </script>