function find(str,cha,num){
var x = str.indexOf(cha);
for(var i = 0;i<num;i++){
x = str.indexOf(cha,x+1);
}
return x;
}
var str = 'http://www.baidu.com/lhf/img/img.jpg';
//获取http://www.baidu.com后面的内容
var index = find(str,'/',2);
var Ineed = str.substring(index);