I have used this same script on other websites and I just can't get it to work with my current project at http://ift.tt/1x8RYC0. After delving into the firefox script debugger, it seems to be a problem with cookies.js not loading, as i'm getting a "$.cookie is not a function" error. I know i've had troubles in the past if jquery itself is loaded after this script, but that is not the case. As far as I can tell, it should be working.
Here is my code added to the BigCommerce header:
<!--Scripting for age verification, added LM 02/03/15 -->
<script type="text/javascript" src="http://ift.tt/1HUYV50"></script>
<script type="text/javascript" src="http://ift.tt/1x8RYCa"></script>
<script type="text/javascript" src="http://ift.tt/1fNVKIb"></script>
<script type="text/javascript" src="http://ift.tt/1x8S1Of"></script>
<link rel="StyleSheet" href="http://ift.tt/1HUYVlu" type="text/css" media="all">
<script type="text/javascript">
$(window).load(function () {
// Halt! Age identification
// Includes checking for and setting a cookie with cookies.js
if(!$.cookie('legal-age')){
var date = new Date();
var minutes = 30;
date.setTime(date.getTime() + (minutes * 60 * 1000));
$('#verify').lightbox_me({
centered: true,
closeClick: false,
closeESC: false,
overlayCSS: {background: 'black', opacity: 1},
closeSelector: '.v-yes',
onClose: function(){
$.cookie('legal-age','yes', {domain: 'torchwoodworks.com', path: '/', expires: date});
}
});
e.preventDefault();
}
});
</script>
<!--end Scripting for age verification -->
Any insight would be appreciated. Thanks!
Aucun commentaire:
Enregistrer un commentaire