質問

 <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.

役に立ちましたか?

解決 2

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>

他のヒント

Try this, window.open will not open in new window, So use target = "_blank"

<a href="#" id="signinFace" >Sign in With Facebook</a>
    <script type="text/javascript">
    $(document).ready(function(){
    $(".signinFace").click(function(){
    $(this).target = "_blank";
    window.location= 'URL_HERE'; 
    return false;     
    });
    });
    </script>
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top