Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当我的页面被加载时,它会使用 jQuery 显示一些 TweenLite 动画。动画的 Javascript 代码位于单独的 .js 文件中。
我需要在第一次打开页面时保留动画,然后将其删除。对我来说显而易见的方法是使用一个会话变量,该变量应该在动画完成后设置。
我知道 jQuery 可以通过 ajax 访问会话变量,但我找不到任何这样做的例子。
我在 stackoverflow 上发现了类似的问题,唯一的答案是使用 localStorage。它与会话有何不同?
在没有 jquery 的情况下尝试这样的事情:
var totalVisits = "<%HttpContext.Current.Session("TOTALVISITS")%>";