anymvs
01-12-2013, 12:43 AM
Hello guys am working with google <script async> the whole situatios
so, google below refers to the following::
:source (https://developers.google.com/speed/docs/best-practices/rtt#PreferAsyncResources):
<script>
var node = document.createElement('script');
node.type = 'text/javascript';
node.async = true;
node.src = 'example.js';
// Now insert the node into the DOM, perhaps using insertBefore()
</script>
So I have convert the above java according to google as,
<script type="text/javascript">
var fcb_js = document.createElement('script');
fcb_js.type = 'text/javascript';
fcb_js.async = true;
fcb_js.src = '/clientscript/vbulletin_facebook.js?v={vb:raw vboptions.simpleversion}';
var fcb_var = document.getElementsByTagName('script')[0];
fcb_var.parentNode.insertBefore(fcb_js, fcb_var);
</script>
or
<script type="text/javascript">
(function() {
var test = document.createElement('script');
test.type = 'text/javascript';
test.async = true;
test.src ='/clientscript/vbulletin_facebook.js?v={vb:raw vboptions.simpleversion}';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(test, s); })();
</script>
Now my problem is that, vbulletin_facebook.js is loading correctly but, I can't connect with facebook as guest or as a member... Now I assume that has an if statement of facebook java, later than the actual statement of vbulletin variable.. Again this seems wrong, because I didn't change any range of any variables instead of actual java architecture, if I try to load the .js normally is working correct...
Any ideas??
Note:: any kind of page tester that I test my forum seems to detect the vbulletin_facebook.js at the same position as with the standard code... md5.js and vbulletin-markert.js
are loaded and seems to work fine, and css files such as additional.css etc are not tested yet but I think may have a problem with that too!!!
Thank you !!
so, google below refers to the following::
:source (https://developers.google.com/speed/docs/best-practices/rtt#PreferAsyncResources):
<script>
var node = document.createElement('script');
node.type = 'text/javascript';
node.async = true;
node.src = 'example.js';
// Now insert the node into the DOM, perhaps using insertBefore()
</script>
So I have convert the above java according to google as,
<script type="text/javascript">
var fcb_js = document.createElement('script');
fcb_js.type = 'text/javascript';
fcb_js.async = true;
fcb_js.src = '/clientscript/vbulletin_facebook.js?v={vb:raw vboptions.simpleversion}';
var fcb_var = document.getElementsByTagName('script')[0];
fcb_var.parentNode.insertBefore(fcb_js, fcb_var);
</script>
or
<script type="text/javascript">
(function() {
var test = document.createElement('script');
test.type = 'text/javascript';
test.async = true;
test.src ='/clientscript/vbulletin_facebook.js?v={vb:raw vboptions.simpleversion}';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(test, s); })();
</script>
Now my problem is that, vbulletin_facebook.js is loading correctly but, I can't connect with facebook as guest or as a member... Now I assume that has an if statement of facebook java, later than the actual statement of vbulletin variable.. Again this seems wrong, because I didn't change any range of any variables instead of actual java architecture, if I try to load the .js normally is working correct...
Any ideas??
Note:: any kind of page tester that I test my forum seems to detect the vbulletin_facebook.js at the same position as with the standard code... md5.js and vbulletin-markert.js
are loaded and seems to work fine, and css files such as additional.css etc are not tested yet but I think may have a problem with that too!!!
Thank you !!