The Arcive of Official vBulletin Modifications Site.It is not a VB3 engine, just a parsed copy! |
|
#1
|
|||
|
|||
help with asynch/delayed loading of FB plugin mod on showthread pages
I've been using a modified jQuery slider with an iframe feed to display our FB fan page activity. I'm using it on a vB 4.2.x installation. The code is currently in my footer template. I began to notice that about 5% of the time on showthread pages, the plugin won't finish loading and will thus cause the page itself not to reach load completion. Granted, 5% of the time isn't much... but it's still not right.
I tried adding the following string to the FB-supplied JS code block, but it made no difference: Code:
js.async=true; I then added the following delayed loading directive, and it worked everywhere but on showthread pages: Code:
var myTimer = window.setTimeout(function() { js.src = "//connect.facebook.net/en_US/sdk.js#xfbml=1&appId=XXXXXXXXXXXXXXXX&version=v2.0"; }, 3000); I can vary the 3 second time to any delay I wish and it works perfectly - everywhere except on any showthread pages! It seems that showthread just ignores this delay code. As a result, sometimes thread pages will not reach a loading completion state. Can anyone either shed some light on why this happens, or perhaps provide a solution for me? Thanks in advance. |
#2
|
|||
|
|||
You use jQuery? What if you wrap all JavaScript within:
HTML Code:
$(function(){ // All of the JavaScript here. }); We might need a link to your forum with a test account in order to debug the issue. |
Благодарность от: | ||
Max Taxable |
#3
|
|||
|
|||
Did you check the browser's console to see if you're getting any js errors in showthread.php?
|
Благодарность от: | ||
Max Taxable |
#4
|
|||
|
|||
Quote:
--------------- Added [DATE]1422649905[/DATE] at [TIME]1422649905[/TIME] --------------- Quote:
--------------- Added [DATE]1422662432[/DATE] at [TIME]1422662432[/TIME] --------------- So... anyone know how to get showthread to parse and apply the following timer directive? (which works fine on all non showthread pages.) Code:
var myTimer = window.setTimeout(function() { // JS thing to do }, 3000); I tried the code in the header template and it won't work from there either. Why won't showthread simply make all of the function calls from the footer or header templates global? It would sure solve my problem if it did. |
|
|
X vBulletin 3.8.12 by vBS Debug Information | |
---|---|
|
|
More Information | |
Template Usage:
Phrase Groups Available:
|
Included Files:
Hooks Called:
|