Refresh.cshtml 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. @{
  2. ViewBag.Title = "Refresh";
  3. }
  4. <span class="showhide" style="width: 100px; font-size: 16px; display:none; color: #18a689; cursor:pointer;"><i class="im-volume-high2" style=" font-size: 18px;"></i> (<s>100</s>)</span>
  5. <script type="text/javascript">
  6. //刷新在线人数
  7. function DoRefresh() {
  8. $.post('/Online/Update/' + $('#hiduserid').val(), null, function (result) {
  9. if (result.toString() == "0") {
  10. if (errorCount == 0) {
  11. errorCount = 1
  12. }
  13. }
  14. else if (result.toString() == "-1") {
  15. if (errorCount == 0) {
  16. alert("用户在其他位置登陆,请重新登陆");
  17. errorCount = 1
  18. window.top.location = '/';
  19. }
  20. }
  21. }, 'text');
  22. }
  23. //$(function () {
  24. // //闪烁图标
  25. // //var num = $('.showhide').children('s').html();
  26. // //if (eval(num) > 0) {
  27. // //setTimeout(function () {
  28. // // $('.showhide').show(500);
  29. // // $('.showhide').hide(500);
  30. // //}, 1110);
  31. // //} else {
  32. // // $('.showhide').hide();
  33. // //}
  34. // // setInterval(DoRefresh, 10000);
  35. // //点击
  36. // $('.showhide').click(function () {
  37. // });
  38. //});
  39. </script>