js 对象转&拼接
2023-09-11 14:20:28 时间
function pars(param, key, encode) { if (param == null) return ''; var arr = []; var t = typeof (param); if (t == 'string' || t == 'number' || t == 'boolean') { arr.push(key + '=' + ((encode == null || encode) ? encodeURIComponent(param) : param)); } else { for (var i in param) { var k = key == null ? i : key + (param instanceof Array ? '[' + i + ']' : '.' + i); arr.push(pars(param[i], k, encode)); } } return arr.join("&"); };
相关文章
- js中的bool值转换及"&&" 、"||"、 "!!"详解
- JS+CSS3 360度全景图插件 - Watch3D.js
- Java 容器 & 泛型:五、HashMap 和 TreeMap的自白
- [Node.js]29. Level 6: Socket.io: Setting up Socket.io server-side & Client socket.io setup
- [Node.js]27. Level 5: URL Building & Doing the Request
- 【COCOS2DX通信(HTTP&SOCKET)相关编译到ANDROID细节总结】编译加入CURL关联LIB与头文件 && 解决PTHREAD的CANCEL函数NDK不支持,找不到SOCKADDR_IN、HTONS等问题;
- [Node.js]29. Level 6: Socket.io: Setting up Socket.io server-side & Client socket.io setup
- 【RF库测试】Encode String To Bytes&Decode Bytes To String& should be string&should be unicode string &should not be string
- WinForm中提示Circular base class dependency involving 'TestEncryption.Form' and 'TestEncryption.Form'
- select * from table where 1<>1
- 华为OD机试 - 服务中心选址(Java & JS & Python)
- 华为OD机试 - 单词倒序(Java & JS & Python)
- 华为OD机试 - Excel单元格数值统计(Java & JS & Python)
- 华为OD机试 - 通信误码(Java & JS & Python)
- 华为OD机试 - 优选核酸检测点(Java & JS & Python)
- 华为OD机试 - 垃圾短信识别(Java & JS & Python)
- 华为OD机试 - 字符串匹配(Java & JS & Python)
- 华为OD机试 - 简易内存池(Java & JS & Python)
- 华为校招机试 - 单词重量(Java & JS & Python)
- 华为OD机试 - 全排列(Java & JS & Python)
- 华为OD机试 - 翻牌求最大分(Java & JS & Python)
- 华为OD机试 - 单向链表中间节点(Java & JS & Python)
- 华为OD机试 - 计算疫情扩散时间(Java & JS & Python)
- AI公开课:03月26日未来十年 AI如何进化—圆桌探讨(乌镇智库理事长、CSDN 创始人&董事长、智源人工智能研究院副院长)之《AI:昨天 · 今天 · 明天》
- 【华为OD机试 2023】开心消消乐(Java & JS & Python)
- JavaScript基础&实战(5)js中的数组、forEach遍历、Date对象、Math、String对象
- hadoop namenode -format Couldn'tload main class "-Djava.library.path=.home.hadoop.hadoop-2.5.2.lib"
- 年度职称申报Q&A清单
- 【JS高级】js之正则相关函数以及正则对象_02
- 华为校招机试 - 数组取最小值(Java & JS & Python)