Forum is closed

Howto suppress generating this Javascript code?

Howto suppress generating this Javascript code?

Hi!

We're using JFBConnect and each page of our site no matter if an article, a menu of what ever kind of Joomla component has the following code embedded. Is there any chance to avoid that JFB software inserts this code fragment into every page? We do have a special Joomla menu page where I do not want that this code gets embedded. I do not mind to patch if you can tell me where this code snippet gets generated and is finally inserted. Within this php file it should be possible to check the url of this given page and ignore insertion of this code?!

Code:

<body><div id="fb-root"></div>

<script type="text/javascript">
window.fbAsyncInit = function() {
FB.init({appId: 'MY_APP_ID', status: false, cookie: true, xfbml: true, oauth: true, channelUrl: 'http://mysite.com/components/com_jfbconnect/assets/jfbcchannel.php'});
FB.Event.subscribe('comment.create', jfbc.social.comment.create);
FB.Event.subscribe('edge.create', jfbc.social.like.create);
};
(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_GB/all.js";
     d.getElementsByTagName('head')[0].appendChild(js);
   }(document));
</script>

Thanks for your support
Frank

guero
useravatar
Offline
92 Posts
Active Subscriptions:

Administrator has disabled public posting. Please login or register in order to proceed.

Re: Howto suppress generating this Javascript code?

Frank,
That code is in the /plugins/system/jfbcsystem.php file. You can remove it if you really know what you're doing, however, I wouldn't recommend it. That code is required for any of the following features:
* Facebook Login
* Automatic login of users
* Any social widgets (Like, Comment, Fan module, etc)
* Facebook Requests/Invites
* Page Tab / Canvas support

Basically, if you're using any of JFBConnect's features on the page you want to remove it from, those features will no longer work. Additionally, the Facebook Javascript file is something that gets cached in the user's browser. While it is executed on each page (which may take 50milli-seconds or so), it should not be re-downloaded on each page, which is where most of the delay would be introduced.

I hope that helps,
Alex

If you use our extensions, please consider leaving a rating and review at the Joomla! Extension Directory:
JFBConnect | SCLogin

alzander
Alex
useravatar
Offline
24108 Posts
Support Specialist
Administrator has disabled public posting. Please login or register in order to proceed.
There are 0 guests also viewing this topic
There are 0 users also viewing this topic

Board Info

Board Stats
 
Total Topics:
11667
Total Polls:
0
Total Posts:
48991
Posts this week:
24
User Info
 
Total Users:
47795
Newest User:
ivoand
Members Online:
1
Guests Online:
820

Online: 
jartä
Social Stream
Refer and Earn

Like our extensions? You're not alone! That's why they're used on tens of thousands of websites. Now you can earn 20% of any sale you refer to SourceCoast.com.

We provide excellent documentation, well laid out sales pages and great support. All you need to do is spread the word and we'll take care of the rest.

Learn About Our Affiliate Program