首頁 後端開發 php教程 js对接微信连wifi提示Uncaught SyntaxError: Unexpected token ILLEGAL

js对接微信连wifi提示Uncaught SyntaxError: Unexpected token ILLEGAL

Jun 06, 2016 pm 08:24 PM
php token

<code><script type="text/javascript">
    /**</script></code>
登入後複製
    • 微信连Wi-Fi协议3.1供运营商portal呼起微信浏览器使用
      */

    1. loadIframe = null;

    2. noResponse = null;

    3. putNoResponse(ev){

      <code>      clearTimeout(noResponse);
       }    
       
        function errorJump()
        {
            alert('该浏览器不支持自动跳转微信请手动打开微信\n如果已跳转请忽略此提示');
        }
        
        myHandler = function(error) {
            errorJump();
        };
        
        function createIframe(){
            var iframe = document.createElement("iframe");
            iframe.style.cssText = "display:none;width:0px;height:0px;";
            document.body.appendChild(iframe);
            loadIframe = iframe;
        }
       //注册回调函数</code>
      登入後複製
    4. jsonpCallback(result){

      <code>     if(result &amp;&amp; result.success){
               alert('WeChat will call up : ' + result.success + '  data:' + result.data);                
               var ua=navigator.userAgent;              
               if (ua.indexOf("iPhone") != -1 ||ua.indexOf("iPod")!=-1||ua.indexOf("iPad") != -1) {   //iPhone             
                   document.location = result.data;
               }else{
                   
                   if('false'=='true'){
                       alert('[强制]该浏览器不支持自动跳转微信请手动打开微信\n如果已跳转请忽略此提示');
                       return;
                   }
                   
                   createIframe();
                   loadIframe.src=result.data;
                   noResponse = setTimeout(function(){
                       errorJump();
                     },3000);
               }                
           }else if(result &amp;&amp; !result.success){
               alert(result.data);
           }
       }
       </code>
      登入後複製
    5. Wechat_GotoRedirect(appId, extend, timestamp, sign, shopId, authUrl, mac, ssid, bssid){

      <code>     
           //将回调函数名称带到服务器端
           var url = "https://wifi.weixin.qq.com/operator/callWechatBrowser.xhtml?appId=" + appId </code>
      登入後複製
      • "&extend=" + extend

      • "&timestamp=" + timestamp

      • "&sign=" + sign;

        <code>   
           //如果sign后面的参数有值,则是新3.1发起的流程
           if(authUrl &amp;&amp; shopId){
               
               </code>
        登入後複製
      1. = "https://wifi.weixin.qq.com/operator/callWechat.xhtml?appId=" + appId

        • "&extend=" + extend

        • "&timestamp=" + timestamp

        • "&sign=" + sign

        • "&shopId=" + shopId

        • "&authUrl=" + encodeURIComponent(authUrl)

        • "&mac=" + mac

        • "&ssid=" + ssid

        • "&bssid=" + bssid;

          <code>       
             }            
             
             //通过dom操作创建script节点实现异步请求  </code>
          登入後複製
      1. script = document.createElement('script');

        <code>    script.setAttribute('src', url);  
            document.getElementsByTagName('head')[0].appendChild(script);
        }</code>
        登入後複製




        <code><img class="mod-simple-follow-page__banner-bg lazy" src="/static/imghw/default1.png" data-src="https://wifi.weixin.qq.com/resources/images/background.jpg" alt="">
        <div class="mod-simple-follow-page__img-shadow"></div>
        <div class="mod-simple-follow-page__logo">
            <img class="mod-simple-follow-page__logo-img lazy" src="/static/imghw/default1.png" data-src="https://wifi.weixin.qq.com/resources/images/t.weixin.logo.png" alt="">
            <p class="mod-simple-follow-page__logo-name"></p>
            <p class="mod-simple-follow-page__logo-welcome">欢迎您</p>
        </div></code>
        登入後複製


        <code><p class="mod-simple-follow-page__attention-txt">欢迎使用微信连Wi-Fi</p>
        <a class="mod-simple-follow-page__attention-btn" onclick="callWechatBrowser()">一键打开微信连Wi-Fi</a></code>
        登入後複製



    本網站聲明
    本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn

    熱門文章

    倉庫:如何復興隊友
    3 週前 By 尊渡假赌尊渡假赌尊渡假赌
    Hello Kitty Island冒險:如何獲得巨型種子
    3 週前 By 尊渡假赌尊渡假赌尊渡假赌
    R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
    1 週前 By 尊渡假赌尊渡假赌尊渡假赌

    熱門文章

    倉庫:如何復興隊友
    3 週前 By 尊渡假赌尊渡假赌尊渡假赌
    Hello Kitty Island冒險:如何獲得巨型種子
    3 週前 By 尊渡假赌尊渡假赌尊渡假赌
    R.E.P.O.能量晶體解釋及其做什麼(黃色晶體)
    1 週前 By 尊渡假赌尊渡假赌尊渡假赌

    熱門文章標籤

    記事本++7.3.1

    記事本++7.3.1

    好用且免費的程式碼編輯器

    SublimeText3漢化版

    SublimeText3漢化版

    中文版,非常好用

    禪工作室 13.0.1

    禪工作室 13.0.1

    強大的PHP整合開發環境

    Dreamweaver CS6

    Dreamweaver CS6

    視覺化網頁開發工具

    SublimeText3 Mac版

    SublimeText3 Mac版

    神級程式碼編輯軟體(SublimeText3)

    適用於 Ubuntu 和 Debian 的 PHP 8.4 安裝和升級指南 適用於 Ubuntu 和 Debian 的 PHP 8.4 安裝和升級指南 Dec 24, 2024 pm 04:42 PM

    適用於 Ubuntu 和 Debian 的 PHP 8.4 安裝和升級指南

    CakePHP 日期和時間 CakePHP 日期和時間 Sep 10, 2024 pm 05:27 PM

    CakePHP 日期和時間

    CakePHP 檔案上傳 CakePHP 檔案上傳 Sep 10, 2024 pm 05:27 PM

    CakePHP 檔案上傳

    CakePHP 路由 CakePHP 路由 Sep 10, 2024 pm 05:25 PM

    CakePHP 路由

    CakePHP 專案配置 CakePHP 專案配置 Sep 10, 2024 pm 05:25 PM

    CakePHP 專案配置

    討論 CakePHP 討論 CakePHP Sep 10, 2024 pm 05:28 PM

    討論 CakePHP

    CakePHP 快速指南 CakePHP 快速指南 Sep 10, 2024 pm 05:27 PM

    CakePHP 快速指南

    如何設定 Visual Studio Code (VS Code) 進行 PHP 開發 如何設定 Visual Studio Code (VS Code) 進行 PHP 開發 Dec 20, 2024 am 11:31 AM

    如何設定 Visual Studio Code (VS Code) 進行 PHP 開發

    See all articles