jkeasley2
Forum Replies Created
-
Forum: Plugins
In reply to: [Simple YouTube Responsive] Javascript conflict with cookie-noticeHaving poked around to get things working again, the issue here is that window.onload is being used by both plugins, so the last javascript loaded overrides any previous javascript attached to the window.onload event.
I have resolved the issue by changing your javascript slightly
window.addEventListener("load", function () { //your code unchanged here }, false);
This resolves the issue for us, and is also a safer way of ensuring that the javascript is loaded when the window loads than attaching the javascript to the window.onload event.
I am going to raise a similar bug with the cookie_notice developers to see if they can make a similar change to their init method ??
Forum: Plugins
In reply to: [Simple YouTube Responsive] Javascript conflict with cookie-noticeHi, the site which is displaying the issue isn’t publicly available, as it is a the stage instance of https://md.catapult.org.uk, and the and the cookie notice module on the production site hasn’t been updated due to this issue.
The observed behaviour is that where the site is loaded in incognito mode (to simulate a first visit to the site from a user) the cookie notice display doesn’t display as expected. no errors are output to the browser console.
The cookie notice plugin is used on sister sites to this site, and operates as expected.
On doing some investigation it was discovered that the issue is being caused by the javascript used to check the cookies and display the notice as necessary wasn’t running as expected, with the init function not being run.
On disabling javascript in the other installed plugins on a 1 by 1 basis, with was found that if the javascript in wp-content/plugins/simple-youtube-responsive/js/youtube-responsive.min.js was commented out the cookie-notice plugin then operates as expected.