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?

3
  • Couldnt you just access the session variable with javascript? Commented Aug 9, 2013 at 13:46
  • Session = cookie behind the scenes... why not just use a cookie? Commented Aug 9, 2013 at 13:47
  • You can see the solution in this [answered question][1] [1]: stackoverflow.com/questions/11123622/… Commented Aug 9, 2013 at 13:47

1 Answer 1

0

Try something like this without jquery:

var totalVisits = "<%HttpContext.Current.Session("TOTALVISITS")%>";
Sign up to request clarification or add additional context in comments.

3 Comments

I use PHP on the page. I understand the idea of counting visits though, and I like it. Thank you.
May be you can try this for PHP: stackoverflow.com/questions/4365738/…
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. :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.