You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have two servers - both call cookiebar-latest.min.js using the same method w/the same parameters:
**Server 1 **
This seems to work fine - no issues.
**Server 2 **
This is where the odd parameter issue is happening.
Somehow when the cookiebar-lates.min.js loads all the parameters seem to be empty or something.
I did a console log tests (w/a local copy of the cookiebar js) to see what the parameters were coming up as - and they all show up as 'false' - screenshot below.
Console log check of what parameter values appear as on Server 2:
Solution
After bit more testing I figured this out - mostly my fault I guess.
Issue was that I had a custom JS file (w/internal logic scripts) also loading on the same page and it also had "cookiebar" in the filename. So when cookiebar-latest.min.js tried to pull the parameters from the script src attribute it pulled from my JS file instead of the actual cookiebar-latest.min.js file. Again I blame myself and will just rename my file but FYI in case you want to tighten the logic there or throw an error if multiples are found or something?
This is the line in cookiebar-latest.min.js that tries to get the parameters from the "src" line but grabs #1 above instead of #2. if (e[i].hasAttribute("src") && (path = e[i].src, path.indexOf("cookiebar") > -1)){
Thank you again for making this handy plugin! 🙏🏻
The text was updated successfully, but these errors were encountered:
cemerson
changed the title
Cookiebar losing parameter values on Linux server but not .NET server?
Cookiebar unable to load parameters if another script with "cookiebar" in name is loaded (first) on the same page.
Mar 13, 2023
#137 Here's a quick stab at it - feel free to do something more elaborate. BTW I only updated the cookiebar-latest.js not the minified file (assume that's automated?)
Original Issue
I have two servers - both call cookiebar-latest.min.js using the same method w/the same parameters:
**Server 1 **
**Server 2 **
Console log check of what parameter values appear as on Server 2:
Solution
After bit more testing I figured this out - mostly my fault I guess.
Issue was that I had a custom JS file (w/internal logic scripts) also loading on the same page and it also had "cookiebar" in the filename. So when cookiebar-latest.min.js tried to pull the parameters from the script src attribute it pulled from my JS file instead of the actual cookiebar-latest.min.js file. Again I blame myself and will just rename my file but FYI in case you want to tighten the logic there or throw an error if multiples are found or something?
This is the line in cookiebar-latest.min.js that tries to get the parameters from the "src" line but grabs #1 above instead of #2.
if (e[i].hasAttribute("src") && (path = e[i].src, path.indexOf("cookiebar") > -1)){
Thank you again for making this handy plugin! 🙏🏻
The text was updated successfully, but these errors were encountered: