- Nov 30, 2012
- 22,840
- 617
- 121
I have asked this question at the phpBB website and on stack exchange and I'm just getting the run around. This should be a simple thing to do! The code given in this website is to be used in a HTML document, but I need it to work in PHP and I need to know what PHP file to place it. I tried that code in the index.php file but that didn't work. https://varvy.com/pagespeed/defer-loading-javascript.html
https://www.phpbb.com/community/viewtopic.php?p=14400621#p14400621
https://www.phpbb.com/community/viewtopic.php?p=14401511#p14401511
http://stackoverflow.com/questions/36449153/defer-javascript-in-phpbb
This is very frustrating as I did it in WordPress with a plugin and I could do it with code, but opted for the plugin. If I can do it with Wordpress with PHP, then why can't I in phpBB?
Found this code, but I don't know what (defined('CMS')) means.
http://3x.impresspages.org/cms/answers/6142/how-can-i-defer-parsing-of-javascript
I don't want to cache anything in someone's browser because I may make a change to my site.
Everywhere I search I get nothing but information on WordPress.
Another possible solution but I don't know if that code is to be placed in each JS file or not. Seems like it. http://www.willmaster.com/blog/javascript/loading-javascript-asynchronous-or-deferred.php
https://www.phpbb.com/community/viewtopic.php?p=14400621#p14400621
https://www.phpbb.com/community/viewtopic.php?p=14401511#p14401511
http://stackoverflow.com/questions/36449153/defer-javascript-in-phpbb
This is very frustrating as I did it in WordPress with a plugin and I could do it with code, but opted for the plugin. If I can do it with Wordpress with PHP, then why can't I in phpBB?
Found this code, but I don't know what (defined('CMS')) means.
Code:
<?php if (defined('CMS')) echo '<script src="'.BASE_URL.LIBRARY_DIR.'js/default.js" type="text/javascript"></script>' ?>
http://3x.impresspages.org/cms/answers/6142/how-can-i-defer-parsing-of-javascript
I don't want to cache anything in someone's browser because I may make a change to my site.
Everywhere I search I get nothing but information on WordPress.
Another possible solution but I don't know if that code is to be placed in each JS file or not. Seems like it. http://www.willmaster.com/blog/javascript/loading-javascript-asynchronous-or-deferred.php