帮助了 AmazingCounters.com 位小伙伴

怎么获取域名后面的参数

 

var str="http://www.baidu.com/Sorado/pic/L21udC9jeXkvYXBhY2hlLXRvbWNhdC04LjAuMjYvYmluL0lNRy8yMDE2LzA4MDMvMTQ3MDIxMDY5MTEyNy5naWY=" 

var len=str.split("/");
icon= str.pop();

方案二:

var str="http://www.baidu.com/Sorado/pic/L21udC9jeXkvYXBhY2hlLXRvbWNhdC04LjAuMjYvYmluL0lNRy8yMDE2LzA4MDMvMTQ3MDIxMDY5MTEyNy5naWY="  

var a = str.match(/\/{1}\w+=$/)[0].slice(1);

a
"L21udC9jeXkvYXBhY2hlLXRvbWNhdC04LjAuMjYvYmluL0lNRy8yMDE2LzA4MDMvMTQ3MDIxMDY5MTEyNy5naWY="

 

posted on 2016-08-04 10:09  云的旋律  阅读(1283)  评论(0编辑  收藏  举报

导航

前端攻城狮分享群