取得Session信息的JS库,session.js
fmms
13年前
<p>Session.js -用于取得当前Session信息。</p> <p>示例代码:</p> <pre class="brush:javascript; toolbar: true; auto-links: false;"><script type='text/javascript'> window.session = { options: { gapi_location: true }, start: function(session){ // can also use window.session global. if (session.first_session.visits > 1){ alert('Hi again from ' + session.location.address.city); } else { if (session.current_session.referrer_info.host.contains('非死book')){ alert('Hi there from '+ session.location.address.city +'. How about liking us on 非死book?'); } else if (session.current_session.search.engine){ alert('Did you find what you were looking for from ' + session.current_session.search.engine + '?'); } } } } </script> <script type='text/javascript' src="http://codejoust.github.com/session.js/session-0.4.js"></script></pre> <p></p> <p><strong>项目主页:</strong><a href="http://www.open-open.com/lib/view/home/1326242525843" target="_blank">http://www.open-open.com/lib/view/home/1326242525843</a></p>