zoukankan      html  css  js  c++  java
  • $.param()的实例应用

    <!DOCTYPE html>
    <html lang="en">
    <head>
    <meta charset="UTF-8">
    <title>Document</title>
    </head>
    <body>

    <pre>
    var jumpUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?'
    var params = {
    appid: 'ssssss', // 公众号appid
    redirect_uri: 'http://woejfoa.com/a/s.html', //回调地址,域名配置同一地址 定位到目录
    response_type: 'code',
    scope: 'snsapi_userinfo',// 需要用户确认登录
    state: 'STATE'
    }
    jumpUrl += $.param(params) + '#wechat_redirect';
    console.log(jumpUrl);
    jQuery.param()函数用于将一个JS数组或纯粹的对象序列化为字符串值,以便用于URL查询字符串或AJAX请求。

    </pre>


    <script src="js/jquery.min.js"></script>
    <script>

    var jumpUrl = 'https://open.weixin.qq.com/connect/oauth2/authorize?'
    var params = {
    appid: 'ssssss', // 公众号appid
    redirect_uri: 'http://woejfoa.com/a/s.html', //回调地址,域名配置同一地址 定位到目录
    response_type: 'code',
    scope: 'snsapi_userinfo',// 需要用户确认登录
    state: 'STATE'
    }
    jumpUrl += $.param(params) + '#wechat_redirect';
    // location.href = jumpUrl // 获取code跳转到回调地址
    console.log(jumpUrl);
    // jQuery.param()函数用于将一个JS数组或纯粹的对象序列化为字符串值,以便用于URL查询字符串或AJAX请求。
    /* https://open.weixin.qq.com/connect/oauth2/authorize?appid=ssssss&redirect_u….html&response_type=code&scope=snsapi_userinfo&state=STATE#wechat_redirect*/
    </script>
    </body>
    </html>

  • 相关阅读:
    小甲鱼与客服的对话,代码与解析
    (role,line_spoken) = each_line.split(':',2) 小甲鱼python 一个任务
    python open() 方法 No such file or directory: 应该怎么解决
    并发编程
    并发编程
    并发编程
    并发编程
    并发编程
    并发编程
    并发编程
  • 原文地址:https://www.cnblogs.com/studyh5/p/7753684.html
Copyright © 2011-2022 走看看