You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 15, 2017. It is now read-only.
So, I have duplicate code here.... just attached to two different selectors (based on where you are located on site).
This code will not work for the $.cookie('name', null) to delete cookie.
$('a.campus-select').click(function(){
var $campus = $(this).attr('rel');
// set or delete cookie
if ($campus == "all") {
$.cookie('Campus', null); // TRYING TO DELETE COOKIE - BUT WONT HERE. WILL BELOW?
console.log("current campus is " + $campus);
console.log($.cookie('Campus'));
} else {
$.cookie('Campus', null);
// setCookie('Campus',$campus,365);
$.cookie('Campus', $campus, { expires: 365, path: '/' });
console.log("just set the cookie for /");
}
});
This code will work work for the $.cookie('name', null) to delete cookie.
$('a.home-campus-select').click(function(){
var $campus = $(this).attr('rel');
var $update_links = $('ul.filter li a');
// set or delete cookie
if ($campus == "all") {
$.cookie('Campus', null); // BUT DELETING A COOKIE HERE WORKS... ?
console.log("current campus is " + $campus);
console.log($.cookie('Campus'));
} else {
$.cookie('Campus', null);
// setCookie('Campus',$campus,365);
$.cookie('Campus', $campus, { expires: 365, path: '/' });
console.log("just set the cookie for /");
}
});
I have literally copied and pasted the code into each other - they are nearly identical - yet - the top will not delete the cookie with $.cookie('Campus', null);
I may be completely missing this - and if so, that is fine :) I just want to know what I'm doing wrong - or if there is a bug!
If you want to see it in action: 2011.newlifechurch.tv
Working one is on the ** home page ** - bottom updates, you can see in the console. When clicking 'All' in the filter - you will see null show up (make sure you select a campus first!)
Then on the updates page (2011.newlifechurch.tv/updates) - if you do the same with the filters, you will see that it won't say 'null', instead saying a campus name.
The text was updated successfully, but these errors were encountered:
e.g. if you're not on the root level of your page, to delete the cookie (being allowed to delete that is from a browser perspective), you need to include the path when deleting.
So, I have duplicate code here.... just attached to two different selectors (based on where you are located on site).
This code will not work for the $.cookie('name', null) to delete cookie.
This code will work work for the $.cookie('name', null) to delete cookie.
I have literally copied and pasted the code into each other - they are nearly identical - yet - the top will not delete the cookie with $.cookie('Campus', null);
I may be completely missing this - and if so, that is fine :) I just want to know what I'm doing wrong - or if there is a bug!
If you want to see it in action: 2011.newlifechurch.tv
Working one is on the ** home page ** - bottom updates, you can see in the console. When clicking 'All' in the filter - you will see null show up (make sure you select a campus first!)
Then on the updates page (2011.newlifechurch.tv/updates) - if you do the same with the filters, you will see that it won't say 'null', instead saying a campus name.
The text was updated successfully, but these errors were encountered: