Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

jQuery Cookie Prompt

Featured Replies

So I'm making our sites compliant just using the notion that if the user is on the site they accept our usage of cookies.

 

I'm using the cookie plugin to have a very simple bar at the top. This is my code:

 

$(document).ready(function(){
  //get the value
  var modalcookie = $.cookie('modalcookie');
  if(modalcookie == "yes") {
 $("p.cookie").hide();
   }

  $("p.cookie").click(function(e){
 $(this).fadeOut("fast");
 $.cookie('modalcookie', "yes");
  }); 
});	

 

It seems OK for me in Chrome but some weird behaviour elsewhere.

 

My girlfriend says for her, when the page loads the message shows but disappears on its own. It should only disappear when the user has clicked it as that's the only way to set the cookie value.

 

And myself, in Firefox, even after you have clicked the message it shows on some pages but not on others.

 

Any ideas? I couldn't find any code examples so I wrote this code myself.

  • Author

Nevermind! I fixed it. I needed to add in a setting for the script to make sure the cookie applied to the root path and not specifically only to the page.

I would be interested in the codes if you still have them :)

 

This cookie thing is driving me mad! How do you know what cookies you are using on your site?

 

I am trying to have a popup box on first visit to the site

 

Any help is much appreciated as i am not sure where to start

 

Thanks

Katrina

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.