Works with Async JavaScript, Otherwise Fails
-
The plugin was working well for months. At some point, I added the Async JavaScript (AJS) plugin, and, in order to keep things working, I had to exclude vidbg.min.js. Some time later, probably around the time of WP upgrade to 4.9, I noticed that if I deactivated AJS, the bg video wouldn’t load. Since I want to use AJS, I didn’t really mind, although I don’t like being locked into having it.
Since I now have a staging site and am able to experiment more freely with the function, I have been investigating the cause of the above. When I view page source, the only apparent difference in the script files is the addition of the “async” element to scripts not excluded from AJS. The order is the same, and the inline js precedes the footer scripts, among which videobg is the last.
The JS Console, however, shows the following error when AJS is not being used:
Uncaught TypeError: $(...).vidbg is not a function at HTMLDocument.<anonymous> ((index):2466) at i (VM803 jquery.js?ver=1.12.4:2) at Object.fireWith [as resolveWith] (VM803 jquery.js?ver=1.12.4:2) at Function.ready (VM803 jquery.js?ver=1.12.4:2) at HTMLDocument.K (VM803 jquery.js?ver=1.12.4:2)As noted, this is not a major problem right now, since I’m mostly content with AJS. Still, I’d feel more secure about this if I understood why this is happening and could avoid the dependency, in case I need to remove AJS in the future.
The page I need help with: [log in to see the link]
The topic ‘Works with Async JavaScript, Otherwise Fails’ is closed to new replies.