摘要:
document.location 这个对象包含了当前URL的信息 location.host 获取port号 location.hostname 设置或获取主机名称 location.href 设置或获取整个URL location.port设置或获取URL的端口号 location.search 阅读全文
posted @ 2019-01-07 16:38
拈花醉
阅读(409)
评论(0)
推荐(0)
摘要:
本文部分摘自:https://www.cnblogs.com/Byme/archive/2017/10/23/7718218.html 阅读全文
posted @ 2019-01-07 16:03
拈花醉
阅读(276)
评论(0)
推荐(0)
摘要:
一、校验数字的js正则表达式 1 数字:^[0-9]*$ 2 n位的数字:^d{n}$ 3 至少n位的数字:^d{n,}$ 4 m-n位的数字:^d{m,n}$ 5 零和非零开头的数字:^(0|[1-9][0-9]*)$ 6 非零开头的最多带两位小数的数字:^([1-9][0-9]*)+(.[0-9 阅读全文
posted @ 2019-01-07 15:26
拈花醉
阅读(483)
评论(0)
推荐(0)
摘要:
第一种方法 用连接符“+”把要连接的字符串连起来 第二种方法 以数组作为中介用 join 连接字符串 函数:John() 字符串拼接功能:使用您选择的分隔符将一个数组合并为一个字符串 阅读全文
posted @ 2019-01-07 14:51
拈花醉
阅读(107514)
评论(0)
推荐(2)
摘要:
三种 js 截取字符串的方法: substring() 方法; substr() 方法; slice() 方法; 1、:substring() 方法:string.substring(from, to) 方法从 from 位置截取到 to 位置,to 可选,没有设置时默认到末尾【用于提取字符串中介于 阅读全文
posted @ 2019-01-07 14:47
拈花醉
阅读(6558)
评论(0)
推荐(0)