Facebook share showing error 'Given URL is not allowed '
<p>I tried the following code for facebook share </p>

<pre><code>&lt;p&gt;
&lt;a  rel="nofollow" target="_blank" class=" icon_facebook "&gt;Share&lt;/a&gt;
&lt;/p&gt;




jQuery(document).ready(function($) {
 window.fbAsyncInit = function() {
    //SDK loaded, initialize it
    FB.init({
        appId      : 'your-app-id',
        xfbml      : true,
        version    : 'v2.5'
    });
};

//load the JavaScript SDK
(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_US/sdk.js";
    fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));

 jQuery('.icon_facebook').click(
function(){
    FB.ui(
      {
    method: 'share',
    name: 'Facebook Dialogs',
  link: 'https://developers.facebook.com/docs/dialogs/',
  picture: 'http://fbrell.com/f8.jpg',
  caption: 'Reference Documentation',
  description: 'Dialogs provide a simple, consistent interface for applications to interface with users.'

},
function(response) {
  if (response &amp;&amp; response.post_id) {
    alert('Post was published.');
  } else {
    alert('Post was not published.');
  }
}
)

});

}

);
</code></pre>

<p>then it showing error .</p>

<blockquote>
  <p>Given URL is not allowed by the Application configuration: One or more
  of the given URLs is not allowed by the App's settings. It must match
  the Website URL or Canvas URL, or the domain must be a subdomain of
  one of the App's domains.</p>
</blockquote>

<p>And the share url in both facebook all ready logined and logout condition is like  <code>https://www.facebook.com/v2.5/dialog/share?app_id=MY APP ID ,.....</code>
But in other websites the working share page url format is different . When not login then it shows like </p>

<pre><code>https://www.facebook.com/login.php?skip_api_login=1&amp;api_key=..
</code></pre>

<p>when some one already login to the faccebook it shows like <code>https://www.facebook.com/v2.3/dialog/share?redirect_uri=https%3A%2F%2Fwww.facebook.com%2Fdialog%2Freturn%2Fclose&amp;display=popup&amp;href=</code> </p>

<blockquote>
  <p>Why my facebook share url is different ? is am missing any code part ?</p>
</blockquote>

<p>Is there any mistake in my code ? please help .</p>