1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889 |
- <!DOCTYPE html>
- <html lang="en">
- <head>
- <meta charset="UTF-8">
- <meta name="viewport" content="width=device-width, initial-scale=1"/>
- <title>微信</title>
- </head>
- <body>
- <style type="text/css">
- *{margin:0; padding:0;}
- img{max-width: 100%; height: auto;}
- .test{height: 600px; max-width: 600px; font-size: 40px;}
- </style>
- <div class="test">
-
- </div>
- <script type="text/javascript">
- function send_request(serverUrl){
- var xmlhttp = null;
- if (window.XMLHttpRequest){
- xmlhttp=new XMLHttpRequest();
- } else if (window.ActiveXObject){
- xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
- }
-
- if (xmlhttp!=null){
- xmlhttp.open( "GET", serverUrl, false );
- xmlhttp.send( null );
- return eval ("(" + xmlhttp.responseText + ")");
- } else {
- alert("Your browser does not support XMLHTTP.");
- }
- };
- function is_weixin() {
- var ua = navigator.userAgent.toLowerCase();
- if (ua.match(/MicroMessenger/i) == "micromessenger") {
- return true;
- } else {
- return false;
- }
- }
- var isWeixin = is_weixin();
- var winHeight = typeof window.innerHeight != 'undefined' ? window.innerHeight : document.documentElement.clientHeight;
- function loadHtml(){
- var div = document.createElement('div');
- div.id = 'weixin-tip';
- div.innerHTML = '<p><img src="./image/live_weixin.jpg" alt="微信打开"/></p>';
- document.body.appendChild(div);
- }
-
- function loadStyleText(cssText) {
- var style = document.createElement('style');
- style.rel = 'stylesheet';
- style.type = 'text/css';
- try {
- style.appendChild(document.createTextNode(cssText));
- } catch (e) {
- style.styleSheet.cssText = cssText; //ie9以下
- }
- var head=document.getElementsByTagName("head")[0]; //head标签之间加上style样式
- head.appendChild(style);
- }
- 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%;}";
- function getQueryVariable(variable){
- var query = window.location.search.substring(1);
- var vars = query.split("&");
- for (var i=0;i<vars.length;i++) {
- var pair = vars[i].split("=");
- if(pair[0] == variable){return pair[1];}
- }
- return(false);
- }
- if(isWeixin){
- loadHtml();
- loadStyleText(cssText);
- }else{
- var o = send_request("../exam/wx/zhumu/meeting/get.htm?uuid="+getQueryVariable("uuid"));
- if (o&&o.entity){
- alert(o.entity);
- window.location = o.entity;
- }else{
- alert("参数无效,请联系系统管理员!")
- }
- }
- </script>
- </body>
- </html>
|