返回jquery ......登陆

jquery 简单使用

骑师2019-01-07 21:29:59265

 页面就绪后调用   genQRCode();     post调用 其他php页面 从数据库取数据   如果json结果为有效 则再调用 php页面生成二维码 返回文件路径 并显示

 $(document).ready(function () {             

         genQRCode(); 

      });

 //get access qrcode

      function genQRCode() {

      var selected_val= "NG";

      var vsel = document.getElementById("mregionid");


      if (vsel !=null)

      {       

        selected_val = document.getElementById("mregionid").value;

      }

      else

      {       

        selected_val = vdefgid;

      }

      //alert(selected_val);

      //alert('<?php echo  $szopenid;?>');

      //alert(selected_val);

      // if (selected_val.length < 5)

      // {

      // $("ttip").text = "您目前还没有开门权限请联系设备管理员";

      // return;

      // }

  $.post("devdir.php", {mprotype: '0', mtrick: '123',mOpenID: '<?php echo  $szopenid;?>',mregionid:selected_val},

  function(data){

    //alert(data);

    if (data.length > 30)

    {    

        var jsonStr = JSON.parse(data);

//    alert(jsonStr.repsonse);

//alert(jsonStr.adata);

   //          alert(jsonStr.repsonse =="00000");



        if (jsonStr.repsonse == "00000")

        {             

          $.post("../encrpt/d.php", {mdata : jsonStr.adata},

    function(imgdata){

                             

    //alert(imgdata);

    //var vv = data.substr(0,4);

    //alert(vv);         

    //if (data.substring(0,4) == \"http\")

   // {

    document.getElementById("qrcodeimg").src = imgdata;    

    // }

    }); 

        }

      

    }

    });        

      }


最新手记推荐

• 用composer安装thinkphp框架的步骤• 省市区接口说明• 用thinkphp,后台新增栏目• 管理员添加编辑删除• 管理员添加编辑删除

全部回复(0)我要回复

暂无评论~
  • 取消回复发送