Questions tagged [jquery-cookie]

A simple, lightweight jQuery plugin for reading, writing and deleting cookies.

jQuery Cookie is a simple, lightweight jQuery plugin for reading, writing and deleting cookies.

327 questions
3
votes
2 answers

Javascript: Change CSS File Dynamically + Cookie

I want to change the used CSS File () dynamically using only javascript and to save changes in cookies. This is a jQuery version that does what I want (ref), but how can I do this in javascript? if($.cookie("css")) { …
Vahid
  • 3,384
  • 2
  • 35
  • 69
2
votes
0 answers

location based inline popup jquery geoio

im trying to add a location based popup to a popup i already have but i dont want both of them to show ie. if there is the USA or Canada i want them to see one popup and if there in the rest of the world see the other. So far with the help of JFK…
user1037444
  • 313
  • 1
  • 6
  • 13
2
votes
2 answers

jquery cookie plugin or code not working in page

I have this code in my page. $(document).ready(function () { $("#ba_object_Code").change(function () { $("#HRBK").val($(this).val()); }); $.cookie('cookie_name', 'cookie_value'); if (sessid == 'xyz') { …
user957178
  • 631
  • 4
  • 15
  • 27
2
votes
2 answers

Create a cookie based on select menu option?

I'm trying to create a select menu in a way that when users select an option and click on the continue button, a cookie is created with the contents of the option. The code directly below works, but it only creates the default "a" cookies rather…
ahuang7
  • 804
  • 1
  • 11
  • 26
2
votes
1 answer

Type error: Property 'get' does not exist on type 'typeof import("js-cookie")'

I'm unable to build the following JS react code: import Cookies from 'js-cookie'; React.useEffect(() => { interface UserInfo { name: string; verified: boolean; } const userInfo = Cookies.get('userInfo'); if (userInfo &&…
user8411456
  • 347
  • 1
  • 5
  • 18
2
votes
1 answer

Not to show popup once closed in jQuery using cookies

I am using the below code for not to show a popup once closed. I tried the below code but it's not working. I checked on google but haven't found the solution. Would you help me out with the solution? $(document).ready(function() { …
Naren Verma
  • 2,205
  • 5
  • 38
  • 95
2
votes
0 answers

Fix the issue of "Cookie Does Not Contain The HTTPOnly Attribute" on the client side

A recent security scan of my site indicates that the site has this issue: Cookie Does Not Contain The "HTTPOnly" Attribute I did research and found links about the fix. For example: https://www.owasp.org/index.php/HttpOnly However, all the links…
curious1
  • 14,155
  • 37
  • 130
  • 231
2
votes
1 answer

Save Javascript toggle state with cookie

I would like to save the state of site-header display. How i can save it with Jquery Cookie? (function ($) { // The initial load event will try and pull the cookie to see if the toggle is "open" var openToggle = getCookie("show") || false; if (…
niznet
  • 107
  • 1
  • 11
2
votes
3 answers

Read value from string which looks like jSon format

I have cookie value stored in following format {stamp:'HMzWoJn8V4ZkdRN1DduMHLhS3dKiDDr6VoXCjjeuDMO2w6V+n2CcOg==',necessary:true,preferences:true,statistics:true,marketing:false,ver:1} and i need to read following values of…
Learning
  • 19,469
  • 39
  • 180
  • 373
2
votes
1 answer

unable to store data in browser cookie with Name and value

I have tried storing the data (i.e., Sudheer Kumar) into a cookie using Jquery and also javascript. But, When storing data into cookie using javascript, data is storing in cookie but without cookie name and also in a string format as shown…
Sudheer Suggu
  • 159
  • 1
  • 9
2
votes
1 answer

If jQuery cookie index of

First, I found many topics on Google, but none of those solved my problem. I couldn't find a right solution to those topics. Using jquery.cookie plugin and trying to make a bookmark system, I store each item id in a cookie like…
Pedram
  • 15,766
  • 10
  • 44
  • 73
2
votes
4 answers

Set date in cookie expiration

How can I set the cookie to expire at this date: 19 Jan 2038 ? The cookie is not set if I try like this: $.cookie('test', true, {expires: "2038-01-19, 03:14:08 UTC"});
Valip
  • 4,440
  • 19
  • 79
  • 150
2
votes
1 answer

Can't return to default language with Google Translate in javascript

i have a code uses google-translate and jquery.cookie to translate all page to other language: $(document).ready(function () { var googTrans = $.cookie('googtrans'); if (googTrans === '/es/en') { //Paint specific flag var src =…
50l3r
  • 1,549
  • 4
  • 16
  • 27
2
votes
1 answer

Find all cookie with name

I using jquery cookie plugin and here are my codes: $('.Bookmark').click(function () { var id = $(this).attr('rel'); if ($(this).hasClass('RedHeart')) { $(this).removeClass('RedHeart'); $.removeCookie('Bookmarkid_' + id,…
Pedram
  • 15,766
  • 10
  • 44
  • 73
2
votes
1 answer

'return false' statement outside function error

I've been trying to implement the following Javascript code into the head of a Wordpress project. I found the original method here: jQuery isotope query filtering results for url but the last 'return false;' keeps throwing the error 'return not in…
deeve
  • 113
  • 6
1 2
3
21 22