title: How can I customize facebook oauth dialog in javascript?
body: <p>I would like to change the location of the page url and I would strongly prefer to have the permissions request dialog open in a separate window.</p>
  
  <p>This is the JavaScript im using:</p>
  
  <pre><code>  &lt;script&gt;
          window.fbAsyncInit = function() {
    FB.init({
      appId      : 'XXXXXXXXXXXXXXX',
      status     : true, 
      cookie     : true,
      xfbml      : true
    });
  };
      (function(d){
     var js, id = 'facebook-jssdk'; if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     d.getElementsByTagName('head')[0].appendChild(js);
   }(document));
    &lt;/script&gt;
  </code></pre>
  
  <p>The dialog that comes up in a separate window doesn't show up in all browsers, freaking IE...</p>
  
  <p>PHP:</p>
  
  <pre><code> // Create our Application instance (replace this with your appId and secret).
      $facebook = new Facebook(array(
        'appId'  =&gt; 'XXXXXXXXXXXXXXXXXXXXXXXXX',
        'secret' =&gt; 'XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX',
      ));
  
      // Get User ID
      $user = $facebook-&gt;getUser();
  
      if ($user) { 
        try {
          // Proceed knowing you have a logged in user who's authenticated.
          $user_profile = $facebook-&gt;api('/me');
        } catch (FacebookApiException $e) {
          error_log($e);
          $user = null;
        }
      }
  
      //  n or logout url will be needed depending on current user state.
      if ($user) {
        $logoutUrl = $facebook-&gt;getLogoutUrl();
      } else {
        $loginUrl = $facebook-&gt;getLoginUrl(   array(
             'scope' =&gt; 'publish_stream,user_birthday,email,offline_access',
             'next'  =&gt; 'LINK HERE',
            ));
      }
  </code></pre>