Welcome Guest, Not a member yet? Register   Sign In
facebook comment box error in codeigniter
#1

[eluser]Unknown[/eluser]
Hi all,
I am trying to develop facebook comments application in my codeignitor project but i face problem like loading comment box and also not display all comment properly and when i use another fresh application codeigniter that work good.

I use this code in view file

[removed](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/all.js#xfbml=1&appId=123456789123456";
fjs[removed].insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));
[removed]
<div class="fb-comments" data-href="http://test.xyz.com:8080" data-num-posts="100" numposts="10" data-width="800"></div>
I use this code in controllers file
&lt;?php
class Fb_comments extends CI_Controller
{
function __construct()
{
parent::__construct();
}

function index()
{
$this->load->view('fb_comments');
}
}
#2

[eluser]Zulkifli Said[/eluser]
try to place the code facebook comment in your view.

place this code after tag &lt;body&gt;


Code:
<div id="fb-root"></div>
[removed]
  window.fbAsyncInit = function() {
    FB.init({
      appId      : '234065836700636', // App ID mading.itt
      channelUrl : '&lt;?php echo current_url()?&gt;, // Channel File
      status     : true, // check login status
      cookie     : true, // enable cookies to allow the server to access the session
      xfbml      : true  // parse XFBML
    });

    // Additional initialization code here
  };

  // Load the SDK Asynchronously
  (function(d){
     var js, id = 'facebook-jssdk', ref = d.getElementsByTagName('script')[0];
     if (d.getElementById(id)) {return;}
     js = d.createElement('script'); js.id = id; js.async = true;
     js.src = "//connect.facebook.net/en_US/all.js";
     ref[removed].insertBefore(js, ref);
   }(document));
[removed]

[removed](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/all.js#xfbml=1&appId=234065836700636";
  fjs[removed].insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));[removed]

and then, paste this code :

Code:
<div class="fb-comments" data-href="localhost" data-num-posts="5" data-width="700"></div>




Theme © iAndrew 2016 - Forum software by © MyBB