日期:2014-05-16 浏览次数:20450 次
var url = location.url;
var arr = url.split('/');
var len = arr.length;
var result = arr[len-1] == '' ? arr[len-2] : arr[len-1];
var url = location.pathname;
var arr = url.split('/');
var len = arr.length;
var result = arr[len-1] == '' ? arr[len-2] : arr[len-1];
var url='http://localhost/test/act/';
var reg=/\/([^\/]+)\/?$/;
alert(reg.exec(url)[1]);