weshare.html 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  2. <html xmlns="http://www.w3.org/1999/xhtml">
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  5. <script src="../wechat.js" type="text/javascript"></script>
  6. <script>
  7. var dataForWeixin={
  8. appId:"",
  9. MsgImg:"https://open.weixin.qq.com/zh_CN/htmledition/res/assets/res-design-download/icon_res_download_wxlogo.png",
  10. TLImg:"https://open.weixin.qq.com/zh_CN/htmledition/res/assets/res-design-download/icon_res_download_wxlogo.png",
  11. url:"https://raw.githubusercontent.com/dodgepudding/wechat-php-sdk/master/test/weshare.html",
  12. title:"微信分享测试文件",
  13. desc:"这里演示了微信分享前调和回调方法",
  14. fakeid:"",
  15. prepare:function(e){
  16. var log = '';
  17. for (var i in e) {
  18. log+= i+':'+e[i]+';';
  19. }
  20. alert(log);
  21. },
  22. callback:function(e){
  23. var log = '';
  24. for (var i in e) {
  25. log+= i+':'+e[i]+';';
  26. }
  27. alert(log);
  28. }
  29. };
  30. WeixinJS.hideToolbar();
  31. WeixinJS.getNetworkType(
  32. function(e){
  33. alert(e);
  34. });
  35. </script>
  36. <title>weshare</title>
  37. </head>
  38. <body>
  39. <h3>这里演示了微信分享前调和回调方法,点击微信右上角分享相关的功能,即可看到各类返回的alert信息</h3>
  40. </body>
  41. </html>