-
-
Notifications
You must be signed in to change notification settings - Fork 115
Description
Original Issue
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?
script 1: <script src="cookiebar-internal-logic.js"></script>
script 2: <script src="cookiebar-latest.min.js?refreshPage=1&tracking=1&remember=30&etc..."></script>
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! ππ»