![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
前端js
Dignissim·HorMo
这个作者很懒,什么都没留下…
展开
-
js对字符串部分进行脱敏处理
/** * 关键信息隐藏 * @param str 字符串 * @param frontLen 字符串前面保留位数 * @param endLen 字符串后面保留位数 * @returns {string} */function hideCode(str, frontLen, endLen) { var len = str.length - frontLen - endLe...原创 2019-02-18 09:48:57 · 4535 阅读 · 1 评论 -
js将编码转换成字符
function utf8ToChar(str) { var iCode, iCode1, iCode2; iCode = parseInt("0x" + str.substr(1, 2)); iCode1 = parseInt("0x" + str.substr(4, 2)); iCode2 = parseInt("0x" + str.substr(7, 2))...原创 2019-02-18 09:56:30 · 2356 阅读 · 0 评论 -
js将URL中的UTF-8字符串转成中文字符串
//将URL中的UTF-8字符串转成中文字符串function getCharFromUtf8(str) { var cstr = ""; var nOffset = 0; if (str == "") return ""; str = str.toLowerCase(); nOffset = str.indexOf("%e"); ...原创 2019-02-18 09:57:01 · 3756 阅读 · 0 评论 -
js去除所有空格
// 去除所有空格function removeAllSpace(str) { return str.replace(/\s+/g, "");}原创 2019-02-18 09:58:16 · 6735 阅读 · 0 评论 -
js重写移动端alert
// 重写移动端alertvar wAlert = window.alert;window.alert = function (message) { try { var iframe = document.createElement("IFRAME"); iframe.style.display = "none"; iframe.set...原创 2019-02-18 09:58:43 · 338 阅读 · 0 评论 -
js获取Cookie
// 获取所有cookiefunction getAllCookie(){var allstr = document.cookie;return allstr;}// 获取指定cookiefunction getOneCookie(objName){var arrStr = document.cookie.split(";");for(var i = 0;i ...转载 2019-04-25 15:27:45 · 2452 阅读 · 0 评论 -
Axios的get和post请求
Axios 是一个基于 promise 的 HTTP 库,可以用在浏览器和 node.js 中。一、axios POST提交数据的三种请求方式写法 axios.post(url,data,config) 1、Content-Type: application/json import axios from 'axios' ...原创 2019-08-09 10:06:26 · 183 阅读 · 0 评论