if ( location.pathname.split("/")[2] == "mine" ) { do something }
Although it would obviously be better to check whether there are enough items in the array that's returned by split:
var a = location.pathname.split("/");
if ( a.length > 2 && a[2] == "mine" ) { do something }
Note that even though array indexes are zero based, we want to specify 2 as the index to get what you refer to as the 2nd argument as split splits "/messages/mine/9889" into an array of 4 items:
["", "messages", "mine", "9889"]
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…