字符串拆分substring(0,3)
数组拆分slice(0,3)
数组自定义删除和替换splice(2,3,"替换字符串")2代表位置,3代表数量,
数组结合concat
数组转字符串join("_")
location拆分url地址
http://www.example.com:8080/path/index.html?a=1&b=2#TOP
location.protocol; // 'http'
location.host; // 'www.example.com'
location.port; // '8080'
location.pathname; // '/path/index.html'
location.search; // '?a=1&b=2'
location.hash; // 'TOP'
数组拆分slice(0,3)
数组自定义删除和替换splice(2,3,"替换字符串")2代表位置,3代表数量,
数组结合concat
数组转字符串join("_")
location拆分url地址
http://www.example.com:8080/path/index.html?a=1&b=2#TOP
location.protocol; // 'http'
location.host; // 'www.example.com'
location.port; // '8080'
location.pathname; // '/path/index.html'
location.search; // '?a=1&b=2'
location.hash; // 'TOP'