function Go(str)是什么意思

来源:百度知道 编辑:UC知道 时间:2024/06/24 18:41:21
function Go(str)
{
document.getElementById("loading").style.display="";
main.location='laoding.asp?Rid='+str;
}是什么意思

这个js函数总的功能是跳转页面
第一行:function Go(str),str是参数,传进来一个字符串
第三行:document.getElementById("loading").style.display="";
将页面中id是loading的元素隐藏。loading可能是个div,或者span或者其他的东西。
第四行:main.location='laoding.asp?Rid='+str;
将主页面(当前页面)跳转到'laoding.asp?Rid='+str这个网址。其中str会用传进来的str那个字符串代替。比如传进来的参数str=home,那这个网址就是laoding.asp?Rid=home
这个函数被调用后,就会跳转到这个网址