获取//URL的最后一个字符串
geturl sub :功能(href ) {
letindex=href.lastindexof (()/);
letstr=href.substring(index1,href.length );
返回str
(,
//URL获取第3.4.5个字符串
getn exturl :功能(href ) {
if(href===undefined ) {
return 'formFields '
}else{
leturls=(href.split(/)/(3) ) )/(href.split (/) )4) )/(href.split (/) ) )5) ) )
控制台. log (URLs ) )。
返回URLs;
}
(,
获取//URL倒数第二个字段
getsecondurl:function{
//获取最后一个正斜杠之前的内容
//varhtmlhref=window.location.href;
letindex=href.lastindexof (()/);
letstr=href.substring(0,index 1);
letURL=str.substring(0,str.length-1 ) )。
返回链接
}