日期:2014-05-16  浏览次数:20505 次

谁能帮我解释一下以下几个内容!!!比内急还急..
function   SinaSideBarShowFocusImage()
{
if(photoList.length   !=   0)
{
if(currentPhotoId   > =   photoList.length)
{
currentPhotoId   =   0;
}

for(var   i   =   currentPhotoId   ;   i   <   photoList.length   ;   i   ++)
{
if(photoList[i][0]   !=   ' '   &&   photoList[i][0].match(/^http:\/\//))//(这行里面(/^http:\/\//)这句是什么意思???)
{
currentPhotoId   =   i;
break;
}
}

if(photoList[currentPhotoId][0]   ==   " ")
{
document.getElementById( "focus_image ").innerHTML   =   " <img   id=\ "focus_image\ "   src=\ "images/is_loading.png\ "     alt=\ "\ "   /> ";
}
else
{
var   temp   =   photoList[currentPhotoId][0];

if(isDocked   ==   1)
{
if(!temp.match(/_100x100/))
{
temp   =   temp.replace(/\./, "_100x100. ");//(这句又是什么意思??)
}
}
else
{
if(temp.match(/_100x100/))
{
temp   =   temp.replace(/_100x100\./,   ". ");(这句又是什么意思??)
}

}


document.getElementById( "focus_image ").innerHTML   =   " <a   href= "   +   photoList[currentPhotoId][1]   +   "> <img   id=\ "focus_image\ "   onLoading=\ "javascript:this.src= 'images/is_loading.png ';\ "   onError=\ "javascript:this.src= 'images/no_internet.png ';\ "   src=\ " "   +   temp   +   "\ "   border=\ "0\ "   alt=\ " "   +     photoList[currentPhotoId][2]   +   "\ "   /> </a> ";
}

currentPhotoId   ++   ;
}
else
{
document.getElementById( "focus_image ").innerHTML   =   " <img   id=\ "focus_image\ "   src=\ "images/is_loading.png\ "     alt=\ "\ "   /> ";
}

//document.getElementById( "focus_image ").innerHTML   =   photoList[currentPhotoId][0];
}


------解决方案--------------------
/^http:\/\//是 正则表达式,表示http://开头的字符
temp = temp.replace(/\./, "_100x100. "); 把.替换为_100X100
temp = temp.replace(/_100x100\./, ". ") 把_100X100替换为点.