emericana
07-22-2011, 06:03 PM
using jquery and cookie plugin.
i made a popup window. when the user clicks on a check box the window closes, forwards them to a new page, and then sets a cookie.
i need it so that when they go back to the original page (where the popup came from) if the browser detects the cookie then the popup does not occur. I do not know why this does not work because when I alert the value of the cookie out, it gives me the correct number. something must be wrong in my logic ?
code on the base page.
<script type="text/javascript">
var test123 = $.cookie('FBCheck');
if ( test123 != 1212){
function popup(Site)
{
window.open(Site,'PopupName','toolbar=no,statusbar=no, location=no,scrollbars=no,resizable=no,width=350,height=500')
}
}
</script>
code on popup (both files are in same directory)
$(document).ready(function() {
$("#Cbox").click(function() {
window.open ("http://www.google.com", "Google");
window.close();
$.cookie('FBCheck', '1212', {expires: 365, path: '/'});
});
});
The jquery source is installed as is the plugin.
Thanks so much for your help in advance!
i made a popup window. when the user clicks on a check box the window closes, forwards them to a new page, and then sets a cookie.
i need it so that when they go back to the original page (where the popup came from) if the browser detects the cookie then the popup does not occur. I do not know why this does not work because when I alert the value of the cookie out, it gives me the correct number. something must be wrong in my logic ?
code on the base page.
<script type="text/javascript">
var test123 = $.cookie('FBCheck');
if ( test123 != 1212){
function popup(Site)
{
window.open(Site,'PopupName','toolbar=no,statusbar=no, location=no,scrollbars=no,resizable=no,width=350,height=500')
}
}
</script>
code on popup (both files are in same directory)
$(document).ready(function() {
$("#Cbox").click(function() {
window.open ("http://www.google.com", "Google");
window.close();
$.cookie('FBCheck', '1212', {expires: 365, path: '/'});
});
});
The jquery source is installed as is the plugin.
Thanks so much for your help in advance!