dcsimg
www.webdeveloper.com
Results 1 to 3 of 3

Thread: Fb Sharing popup window

  1. #1
    Join Date
    Aug 2014
    Posts
    3

    Fb Sharing popup window

    Hello community,

    I want to get/make a code for Fb Sharing popup window which requires firstly sharing and next getting an alert. I tried alone but I couldn't complete it. So, I searched in google and I found an interesting code with demo (Here) which works there perfectly.

    So, I got this code as it was and put this in my page (Here) in a test thread and changed the appId. But when I run it i get this message: "An error has occured. Please try again later". Also, I saw that in my popup window the appId wasn't typed on link (but in demo page where i got the code the appId is displayed on link) and when I put it manually it worked. So, what could be the issue? Can someone guess?

    Here is the code which i use:
    HTML Code:
    <body bgcolor="#F7F7F7">
    <script type="text/javascript" src="http://connect.facebook.net/en_US/all.js"></script>
    <div id="fb-root"></div>
    <script type="text/javascript">
    	window.fbAsyncInit = function() {
    		FB.init({
    		  appId   : '276254499246059',
    		  status  : true,
    		  cookie  : true,
    		  xfbml   : true 
    		});
    	};
    </script>
    
    <script type="text/javascript">		
    	function streampublish_popup(){
    		FB.ui(
    		{
    			method: 'stream.publish',
    			attachment: {
    				name: 'Demo Pulish To Wall With Popup And Call Back Function',
    				description: (
    							   "I have experienced with Share On Wall with Popup windows and would like to share with you. Check it now."
    							),
    				href: "http://4rapiddev.com/facebook-graph-api/facebook-publish-to-wall-with-popup-or-dialog-and-call-back/",
    				media: [
    					{
    					'type':'image',
    					'src':'http://4rapiddev.com/wp-content/uploads/2011/09/Example-Publish-To-Wall-With-Popup-Windows.jpg',
    					'href':'http://4rapiddev.com/facebook-graph-api/facebook-publish-to-wall-with-popup-or-dialog-and-call-back/'
    					}
    				]
    			},
    	        display: 'popup'
    		},
    		function(response) {
    		    if (response && response.post_id) {
    				alert('Post was published with post_id:' + response.post_id);
    			} else {
    				alert('Post was not published.');
    			}
    		});
    	}
    </script>
    
    <script type="text/javascript">	
    	function streampublish_dialogs()
    	{
    		FB.ui(
    		{
    			method: 'feed',
    			name: 'Demo Pulish To Wall With Dialog And Call Back Function',
    			link: 'http://4rapiddev.com/facebook-graph-api/facebook-publish-to-wall-with-popup-or-dialog-and-call-back/',
    			picture: 'http://4rapiddev.com/wp-content/uploads/2011/09/Example-Publish-To-Wall-With-Dialog.jpg',
    			description: 'I have experienced with Share On Wall with Facebook Dialog and would like to share with you. Check it now.'
    			},
    			function(response) {
    				if (response && response.post_id) {
    					alert('Post was published with post_id:' + response.post_id);
    				} else {
    				  	alert('Post was not published.');
    				}
    			}
    		);
    	}
    </script>
    <h3>Demo Publish To Wall With Popup Or Dialog And Call Back</h3>
    <a href="javascript:void(0);" onClick="streampublish_popup();">Publish To Wall With Popup</a><br><br>
    <a href="javascript:void(0);" onClick="streampublish_dialogs();">Publish To Wall With Dialog</a>
    </body>
    </html>
    Sorry for my pure english. If there is something misunderstood please ask me. Thanks in advance.

  2. #2
    Join Date
    Aug 2014
    Posts
    3
    Any pieces of advice???

  3. #3
    Join Date
    Aug 2014
    Posts
    3
    Solved

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles