I'm not too sure why my code is causing this.
I have this jquery script in the header:
<script>
$(document).ready(function() {
$('.control').on('click', function(e) {
e.preventDefault();
var field = $(this).data('field');
$('.hider:visible').fadeOut("slow", function() {
$('#' + field + '-gallery, #' + field + '-tag').fadeIn("slow");
});
});
var randomIndex = Math.floor((Math.random() * 100) + 1) % 3;
console.log(randomIndex);
var field = $($('a').get(randomIndex)).data('field');
$('#' + field + '-gallery, #' + field + '-tag').fadeIn("slow");
});
</script>
when I reload the page, nothing happens so it appears the script isn't running. When I inspect the page on Chrome, I see there is this error which is in a tab called (program) and it's in the first few lines line:
if (window.top.require) {
Uncaught SyntaxError: Unexpected token ILLEGAL
window.top.require("ripple/bootstrap").inject(window, document);}
I don't know what it is in my code to cause this error. When I take out my script, it goes away. Not too sure if it's something with wordpress or jqueryUI (I have that loaded for another plugin).