yuwensong
<!doctype html>
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <meta name="viewport" content="width=640,user-scalable=no,target-densitydpi=device-dpi" user-scalable=no />
        <title>API Test</title>
    </head>

    <body class="">
        <div>
            <input type="text" class="openid" name="openid"/>
            <div class="mk-content">
                <input type="button" id="openid" class="test" value="测试获取Openid" />
            </div>
        </div>
    </body>
</html>
<script type="text/javascript">
    function MCS_ClientNotify(EventData) { 
        EventData = strToJson(EventData); 
        switch(EventData[\'event\']){ 
            case \'OnUserChange\':{ 
                //EventData[\'userid\']就是当前聊天的用户openid 
                console.log(EventData[\'userid\']); 
                document.getElementById("openid").value=EventData[\'userid\'];
                break; 
                } 
            case \'OnMapMsgClick\':{ 
                break; 
                } 
        } 
    } 
    function strToJson(str){ 
        var json = (new Function("return " + str))(); 
        return json; 
    }
</script>

分类:

技术点:

相关文章:

  • 2022-01-18
  • 2022-02-08
  • 2022-12-23
  • 2022-12-23
  • 2021-12-05
  • 2021-11-27
  • 2021-07-20
  • 2022-02-09
猜你喜欢
  • 2021-09-27
  • 2022-01-29
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案