方法一:
代码语言:javascript复制var url = "https://www.baidu.com/abc/xyz";
url = '/' url.split('/').slice(3).join('/');
方法二:
代码语言:javascript复制var url = "https://www.baidu.com/abc/xyz";
url = url.replace(/^https://[^/] /, "");
方法一:
代码语言:javascript复制var url = "https://www.baidu.com/abc/xyz";
url = '/' url.split('/').slice(3).join('/');
方法二:
代码语言:javascript复制var url = "https://www.baidu.com/abc/xyz";
url = url.replace(/^https://[^/] /, "");