codefog / contao-cookiebar

Display the information about cookies on your Contao website
MIT License
26 stars 9 forks source link

IE10 Support / Javascript-Error and CookieBar didn’t show up. #63

Closed Blog404DE closed 5 years ago

Blog404DE commented 5 years ago

After testing this Contao extension i’ve seen some problems with IE10:

One problem is the following javascript-error: IE10 - Script 5007: Unable to get property 'cookiebar' of undefined or null reference

It seems to be raised by the following line (Line 9): var cookieName = cookiebar.dataset.cookiebar;

After debugging a bit, it seem’s that cookiebar.dataset is undefined, because the dataset-property is only supported by IE11 and older (Reference)

On IE10, you have to explicit get the attributes like: xyz.getAttribute('data-cookiebar‘)

The same change is needed on line 33: var ttl = cookiebar.dataset.cookiebarTtl ? parseInt(cookiebar.dataset.cookiebarTtl, 10) : 365;

But even with this 2 smaller changes, the Cookiebar didn’t show up. There must be another IE10-compatibility-bug :-(

qzminski commented 5 years ago

Sorry but IE10 is dead and will not be supported by this extension.