Note that there are some explanatory texts on larger screens.

plurals
  1. POASP.NET Facebook Connect Confusion: Property 'open' of object [object DOMWindow] is not a function
    text
    copied!<p>I am trying to implement Facebook Connect functionality into a website that I am working on. The site uses ASP.NET, a master page that wraps every existing page (including my login page) and Ajax Control Toolkit for some controls. I am using JavaScript SDK functions as the Facebook Documentation dictates. Here is the code to call Facebook API:</p> <pre><code>`&lt;div id="fb-root"&gt; &lt;/div&gt; &lt;script type="text/javascript"&gt; (function (d, s, id) { var js, fjs = d.getElementsByTagName(s)[0]; if (d.getElementById(id)) return; js = d.createElement(s); js.id = id; js.src = "//connect.facebook.net/en_GB/all.js#xfbml=1&amp;appId=APP_ID"; fjs.parentNode.insertBefore(js, fjs); } (document, 'script', 'facebook-jssdk')); &lt;/script&gt;` </code></pre> <p>And here is the code that supplies users an entry point to Facebook Login with an anonymous JavaScript function:</p> <pre><code>&lt;input type="button" onclick=" FB.login(function(response) { if (response.authResponse) { console.log('Welcome! Fetching your information.... '); FB.api('/me', function(response) { console.log('Good to see you, ' + response.name + '.'); FB.logout(function(response) { console.log('Logged out.'); }); }); } else { console.log('User cancelled login or did not fully authorize.'); } }, {scope: 'email'});" value="Login Facebook" /&gt; </code></pre> <p>The problem is that I get an exception saying that window.open is not a function but a property of the object and the Facebook Login dialog won't appear (The exact exception message is as in the title). I don't understand where this error comes from. I have been dealing with this problem for a day and now I have got desperate about solving it. Is there a way to find the source of problem? Can you please help?</p> <p>Thanks in advance.</p> <p>Note: The weird thing is that it works when I create a new page without using the Master Page and migrate all the Facebook calls to the new page.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload