Question Disable the js loading for guests

Status
Not open for further replies.

galerio

Customer
I need to disable the load of the javascripts for guests because:
1- this product is not displayed to guests and I want to save bandwitdh and make my site load faster
2- this product loads the jquery js and for guests I need to load it manually just where I want to, so it results in a double load of jquery in some pages

For theese resons (in particular the second one because it creates conflicts with some other js) I need to disable at all the products for guests.
How can I do this?
 
Solved in this way:
modify the plugin Show Thread: Insert JS with this code
Code:
if ($vbulletin->userinfo['usergroupid'] !== 1)
{
require(DIR . '/dbtech/thanks/hooks/showthread_complete.php');
}
 
this product loads the jquery js and for guests I need to load it manually just where I want to, so it results in a double load of jquery in some pages
With well-coded mods, this won't be a problem. All my jQuery calls are wrapped in "noConflict", meaning if there's any other jQuery or other functionality in the $ variable, those scripts will not break.

If other mods do not use this, then you should contact the author of that mod and request they add the noConflict code to their loader.

For the future I'll look into not loading the JS to UGs that cannot click any buttons.
 
Status
Not open for further replies.

Legacy Advanced Post Thanks / Like

vBulletin 3.8.x vBulletin 4.x.x
Seller
DragonByte Technologies
Release date
Last update
Total downloads
4,049
Customer rating
5.00 star(s) 1 ratings
Back
Top