zoukankan      html  css  js  c++  java
  • JS 统计用户访问情况

     1 var guid = '';
     2 var pageUrl = window.location.href;
     3 $(function () {
     4     $.ajax({
     5         type: "GET",
     6         url: 'http://xxxx.cn/weeshow/Admin/B2C/NBPlanVisitor/FirstVisit?pageUrl=' + pageUrl,
     7         dataType: 'jsonp',
     8         jsonp: "callback",
     9         jsonpCallback: "jsonpCallback",
    10         processData: false,
    11         async: false,
    12         success: function (data) {
    13             guid = data[0].Guid;
    14             CheckVisit();
    15         },
    16         error: function (XMLHttpRequest, textStatus, errorThrown) {
    17             //alert(XMLHttpRequest.status);
    18             //alert(XMLHttpRequest.readyState);
    19             //alert(textStatus);
    20             console.log("提交失败!");
    21         }
    22     });
    23 
    24 })
    25 function CheckVisit() {
    26     setTimeout(function () {
    27         $.ajax({
    28             type: "GET",
    29             url: 'http://xxx.cn/weeshow/Admin/B2C/NBPlanVisitor/CheckVisit?guid=' + guid,
    30             dataType: 'jsonp',
    31             jsonp: "callback",
    32             jsonpCallback: "jsonpCallback",
    33             processData: false,
    34             async: false,
    35             success: function (data) {
    36                 CheckVisit();
    37             },
    38             error: function (XMLHttpRequest, textStatus, errorThrown) {
    39                 console.log("提交失败!");
    40             }
    41         });
    42     }, 1000);
    43 }
  • 相关阅读:
    Lambda
    Guava
    创建数据库时报错 'str' object has no attribute 'decode'
    服务器并发测试(jmeter)
    Mosquitto 创建用户自动输入密码
    menuconfig 语法与用法
    Django操作mongodb
    mqtt mosquitto 安装与使用
    python 使用mongodb数据库
    djangorestframework token 认证
  • 原文地址:https://www.cnblogs.com/lijianhong90/p/10333014.html
Copyright © 2011-2022 走看看