jump.html 2.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1"/>
  6. <title>微信</title>
  7. </head>
  8. <body>
  9. <style type="text/css">
  10. *{margin:0; padding:0;}
  11. img{max-width: 100%; height: auto;}
  12. .test{height: 600px; max-width: 600px; font-size: 40px;}
  13. </style>
  14. <div class="test">
  15. </div>
  16. <script type="text/javascript">
  17. function send_request(serverUrl){
  18. var xmlhttp = null;
  19. if (window.XMLHttpRequest){
  20. xmlhttp=new XMLHttpRequest();
  21. } else if (window.ActiveXObject){
  22. xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  23. }
  24. if (xmlhttp!=null){
  25. xmlhttp.open( "GET", serverUrl, false );
  26. xmlhttp.send( null );
  27. return eval ("(" + xmlhttp.responseText + ")");
  28. } else {
  29. alert("Your browser does not support XMLHTTP.");
  30. }
  31. };
  32. function is_weixin() {
  33. var ua = navigator.userAgent.toLowerCase();
  34. if (ua.match(/MicroMessenger/i) == "micromessenger") {
  35. return true;
  36. } else {
  37. return false;
  38. }
  39. }
  40. var isWeixin = is_weixin();
  41. var winHeight = typeof window.innerHeight != 'undefined' ? window.innerHeight : document.documentElement.clientHeight;
  42. function loadHtml(){
  43. var div = document.createElement('div');
  44. div.id = 'weixin-tip';
  45. div.innerHTML = '<p><img src="./image/live_weixin.jpg" alt="微信打开"/></p>';
  46. document.body.appendChild(div);
  47. }
  48. function loadStyleText(cssText) {
  49. var style = document.createElement('style');
  50. style.rel = 'stylesheet';
  51. style.type = 'text/css';
  52. try {
  53. style.appendChild(document.createTextNode(cssText));
  54. } catch (e) {
  55. style.styleSheet.cssText = cssText; //ie9以下
  56. }
  57. var head=document.getElementsByTagName("head")[0]; //head标签之间加上style样式
  58. head.appendChild(style);
  59. }
  60. var cssText = "#weixin-tip{position: fixed; left:0; top:0; background: rgba(0,0,0,0.8); filter:alpha(opacity=80); width: 100%; height:100%; z-index: 100;} #weixin-tip p{text-align: center; margin-top: 10%; padding:0 5%;}";
  61. function getQueryVariable(variable){
  62. var query = window.location.search.substring(1);
  63. var vars = query.split("&");
  64. for (var i=0;i<vars.length;i++) {
  65. var pair = vars[i].split("=");
  66. if(pair[0] == variable){return pair[1];}
  67. }
  68. return(false);
  69. }
  70. if(isWeixin){
  71. loadHtml();
  72. loadStyleText(cssText);
  73. }else{
  74. var o = send_request("../exam/wx/zhumu/meeting/get.htm?uuid="+getQueryVariable("uuid"));
  75. if (o&&o.entity){
  76. alert(o.entity);
  77. window.location = o.entity;
  78. }else{
  79. alert("参数无效,请联系系统管理员!")
  80. }
  81. }
  82. </script>
  83. </body>
  84. </html>