470 posts
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
SaurabhSharma says

For example, I have two copies of a page; both of which contain same jquery code. Something like:

$(document).ready(function () {
    var flag = 0;
    $('#anchor').click(function () {
        flag = 1;
    });
})

When I am on Page1 and clicked #anchor, the flag value changed to 1. Now if I return to Page2, I need the flag value to get modified, depending upon the action performed on Page 1; and vice versa. i.e. Modifying a variable on one page should update itself globally for all pages. How can this be done?

Any help is most appreciated. Thanks in advance

2333 posts
  • Has referred 100+ members
  • Has sold $40,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Helped several times protecting Envato Market against copyright violations
+5 more
CreativeMilk says

Use a cookie(use and not eat ;))

451 posts Don't be a HATER!
  • Has referred 10+ members
  • Has sold $125,000+ on Envato Market
  • Has collected 10+ items on Envato Market
  • Sells items exclusively on Envato Market
+6 more
webinpixels says
Use a cookie(use and not eat ;))

+1 :D

470 posts
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
SaurabhSharma says
Use a cookie(use and not eat ;))

Thanks Mark. I will try with that. :)

2529 posts
  • Has been part of the Envato Community for over 6 years
  • Has referred 10+ members
  • Has sold $40,000+ on Envato Market
  • Interviewed on an Envato blog
+11 more
JeffreyWay says

Or – if it isn’t sensitive data, you can pass it through the query string.

But yeah – setting a cookie is probably the easiest method.

470 posts
  • Sells items exclusively on Envato Market
  • Has been part of the Envato Community for over 5 years
  • Has sold $250,000+ on Envato Market
  • Elite Author: Sold more than $75,000 on Envato Market
+6 more
SaurabhSharma says
Or – if it isn’t sensitive data, you can pass it through the query string. But yeah – setting a cookie is probably the easiest method.

Thanks Jeff. I had this done successfully with cookies and jquery cookie plugin. :)

Helpful Information

  • Please read our community guidelines. Self promotion and discussion of piracy is not allowed.
  • Open a support ticket if you would like specific help with your account, deposits or purchases.
  • Item Support by authors is optional and may vary. Please see the Support tab on each item page.

Most of all, enjoy your time here. Thank you for being a valued Envato community member.

Post Reply

Format your entry with some basic HTML. Read the Full Details, or here is a refresher:

<strong></strong> to make things bold
<em></em> to emphasize
<ul><li> or <ol><li> to make lists
<h3> or <h4> to make headings
<pre></pre> for code blocks
<code></code> for a few words of code
<a></a> for links
<img> to paste in an image (it'll need to be hosted somewhere else though)
<blockquote></blockquote> to quote somebody

:grin: :shocked: :cry: Complete List of Smiley Codes

by
by
by
by
by
by