1

When my page is loaded, it displays some TweenLite animation, using jQuery. Javascript code for animation is located in separate .js file.

I need to keep the animation when the page is opened for the first time, and remove it afterwards. The obvious way for me would be to use a session variable which should be set after animation is complete.

I know that jQuery can access session variables through ajax, but I cannot find any examples of doing it.

I found similar question here, on stackoverflow, and the only answer to it is to use a localStorage. How is it different from a session?

olka_sb
  • 37
  • 1
  • 10

1 Answers1

0

Try something like this without jquery:

var totalVisits = "<%HttpContext.Current.Session("TOTALVISITS")%>";
Abhishek Jain
  • 2,597
  • 1
  • 18
  • 12
  • I use PHP on the page. I understand the idea of counting visits though, and I like it. Thank you. – olka_sb Aug 09 '13 at 13:49
  • May be you can try this for PHP: http://stackoverflow.com/questions/4365738/how-to-access-php-session-variables-from-jquery-function-in-a-js-file – Abhishek Jain Aug 09 '13 at 13:51
  • As I said, the javascript code is in .js file, not .php. The only reason I did not accept your answer yet is because I have to wait a couple more minutes. :) – olka_sb Aug 09 '13 at 13:56