方法一:
var url = "http://blog.csdn.net/jungsagacity/article/details/7645580";
url = '/' + url.split('/').slice(3).join('/');
方法二:
var url = "http://blog.csdn.net/jungsagacity/article/details/7645580";
url = url.replace(/^http:\/\/[^/]+/, "");
方法一:
var url = "http://blog.csdn.net/jungsagacity/article/details/7645580";
url = '/' + url.split('/').slice(3).join('/');
方法二:
var url = "http://blog.csdn.net/jungsagacity/article/details/7645580";
url = url.replace(/^http:\/\/[^/]+/, "");
本文标题:js 去掉url域名
本文链接:https://www.haomeiwen.com/subject/wlckwhtx.html
网友评论