Topic-icon JCH & JFBConnect: JS problem page generation

Active Subscriptions:

None
Hi!
I used JCH since years with many components.
Yesterday I bought your JFBConnect and installed it on my Sécurité Informatique website.

Before activating JFBConnect, each CSS and JS created by JCHOptimize was unique: 1 css and 1 js for each page of my website (correct optimisation)

Now activating JFBConnect, each new page request is generating a new JS !!! It's pretty bad as I'm searching pagespeed optimisation.
So I used the JCH debug function and I found that the difference under each page is the following: the jfbc.token ... as follow

/***! script declaration !***/
try{jfbc.login.logout_facebook=false;jfbc.base='www.akaoma.com/';jfbc.return_url='Lw==';...login.use_popup=true;
jfbc.login.auto='1';jfbc.login.logged_in=false;jfbc.token='be3d0a5bc9ab5089ebdfd5b8ff64384b';jfbc.init();}catch(e){console.error('Error in script declaration; Error:'+e.message);};


So having the jch PRO paid plugin, I included the jfbc.token in the Exclude 'in-page' scripts ... to avoid having this script declaration into the JS, but directly into the page. The exclusion is working (JS are exactly the same for many request on same page) but unfortunately nothing is displayed on my website... (no buttons...) If I create a JFBConnect Intro Text, I can however see it on the screen (but no buttons)

What's the best configuration for JBFConnect and JCH? (to avoid each time a new JS page!)
By the way, is there any possibility to create a kind of consolidation of different JS and CSS coming from twitter, facebook, etc.. because there're making lot of requests!

Could you please tell me how to proceed for JCH and JFB?? Thanks for your fast feedback!
The topic has been locked.
Support Specialist
10 years 4 months ago #56673 by alzander
I'd recommend excluding our jfbconnect.js file as well. When that file is optimized, it can cause it to execute out of the intended order, which can cause multiple issues when communicating with 3rd party networks.

By the way, is there any possibility to create a kind of consolidation of different JS and CSS coming from twitter, facebook, etc.. because there're making lot of requests!

There's no way we can pre-fetch the JS and CSS files from each network. Unfortunately, they change regularly and there's no mechanism that any network has to reliably load them locally or included in your code. The good news is that all social networks use huge amounts of caching. The files should only need to be loaded one time for the user, from any site, and they'd load near instantly on your site from your browser's cache instead of an actual network connection to fetch them. If you run site scan tools for the waterfall of loading elements, those will always show each file loading as if for the first time, but that's very unrealistic in the real world and certainly won't happen as the user navigates to multiple pages of your site.

I hope that helps explain, but if you still have issues after the above, let us know a page we can see things not loading properly and we can look into things further.

Thanks,
Alex
The topic has been locked.
Active Subscriptions:

None
10 years 4 months ago #56674 by stormbyte
Thanks for your fast feedback Alex!

I've done what you said:
- Exclusion of jfbconnect.js (I tried both "Exclude js files from these extensions" and also "Exclude individual file dynamically" under JCH)
- Exclusion of inline jfbc.token

Unfortunately same situation, as no button is displayed on my webpage. You can check by yourself on the site www.akaoma.com The JS from JCH is having no more jfbconnect information.

In the HTML webpage there's your script declaration, because I used EXCLUSION FROM INPAGE (JCH parameter)
<script>jfbc.login.logout_facebook=false;jfbc.base='www.akaoma.com/';jfbc.return_url='L2Zvcm...fe1fdf1';jfbc.init();

jfbconnect.js is downloading well alone, I see it in the waterfall...
And all request (fb, twitter, etc.) are correctly done in this same waterfall

So what can I do now? Please check code on my website and advice! ;-) I left JCH in debug mode if it may help.
Kind regards.
The topic has been locked.
Active Subscriptions:

None
10 years 4 months ago #56683 by stormbyte
Any chance to have fast support please? I'm waiting your solution to work before launching a huge promotion campaign.
Your JFBConnect is activated but not working (no icons). Please check on my website. Please help!
The topic has been locked.
Support Specialist
10 years 4 months ago #56686 by alzander
I'm unsure what's currently happening on your home page, but it keeps reloading. There seems to be some POST request that is automatically submitting over and over again, which is resulting in constant redirects back to the home page.

I am able to navigate to other pages though and tested from your contact-devis/questions-securite page. On there, I can't see the social buttons as you mention. The cause is because we intentionally hide those buttons until after the page has loaded since each of those buttons has their own 'pop-in', which can be jarring. However, the Javascript from our jfbconnect.js file which should trigger those buttons to display isn't being executed properly.

Can you prevent our jfbconnect.js file from being optimized altogether and see what happens? The lazy-loading method that's being used will cause it to load well after the page has finished, which will cause multiple issues like you've seen above. Our Javascript needs to load before the DOM is ready to allow for many of our features to operate and to ensure our code is available before the social network's Javascript code is loaded.

I hope that helps get you going,
Alex
The topic has been locked.