This should do it:
var newClass = window.location.href;
newClass = newClass.substring(newClass.lastIndexOf('/')+1, 5);
$('body').addClass(newClass);
The whole "five characters" thing is a little worrisome; that kind of arbitrary cutoff is usually a red flag. I'd recommend catching everything until an _ or .:
newClass = newClass.match(//[^/]+(_|.)[^/]+$/);
That pattern should yield the following:
../about_us.html
: about
../something.html
: something
- .
./has_two_underscores.html
: has
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…