javascript中获得地址栏参数QueryString

80酷酷网    80kuku.com

  <HTML><HEAD><TITLE>都市女孩社区</TITLE>
<META http-equiv=Content-Type content=text/html;charset=gb2312>
<LINK language=javascript>
function GetQueryvalue(sorStr,panStr)
{
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

CopyRight: 网络有限公司 Joysos.Com
Description: 在javascript内实现QueryString

CreatDate: 2004-02-28
AuthorName:: WuMeibo wumeibojoysos.com
LastUpdate:
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
var vStr="";
if (sorStr==null || sorStr=="" || panStr==null || panStr=="") return vStr;
sorStr = sorStr.toLowerCase();
panStr += "=";
var itmp=sorStr.indexOf(panStr);
if (itmp<0){return vStr;}
sorStr = sorStr.substr(itmp + panStr.length);
itmp=sorStr.indexOf("&");
if (itmp<0)
{
return sorStr;
}
else
{
sorStr=sorStr.substr(0,itmp);
return sorStr;
}
}



function LoadFrame()
{
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

CopyRight: 网络有限公司 Joysos.Com
Description: 根据QueryString动态加载右侧框架

CreatDate: 2004-02-28
AuthorName:: WuMeibo wumeibojoysos.com
LastUpdate: By wumeibo 2003-03-09
url参数变更 增加可以链到任意文章
和论坛且左侧导航条可根据参数变化
注:
url参数lefttree优先权最高
其次为topic
再次为forum
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/


var url = "main.htm?";
var strGetQuery = document.location.search;

//根据forum参数加载指定的论坛到右侧框架;
var forum = GetQueryvalue(strGetQuery,'forum');
//根据forum参数加载指定的文章到右侧框架;
var topic = GetQueryvalue(strGetQuery,'topic');
//根据forum参数加载指定的导航条坛到右侧框架;
var lefttree = GetQueryvalue(strGetQuery,'lefttree');

if( lefttree.toUpperCase() != "DJ" )
{
//刷新左侧导航条为都市女孩;
tree.location.switchSysBar()
{ //中间点击按钮的文字变化

if (switchPoint.innerText=="3")
{
switchPoint.innerText="4"
document.all("frmTitle").style.display="none"
}
else
{
switchPoint.innerText="3"
document.all("frmTitle").style.display=""
}
}
</script>
</HEAD>
<!-- 使用按钮控制导航菜单的显示与关闭,这部分代码暂时停止工作 2004-03-03 by 武眉博 wumeibojoysos.com
<FRAMESET name=fstMain onload="LoadFrame()" cols=130,*>
<FRAME border=1 name=tree src="index/index.files/111.htm"
frameBorder=auto noResize target="_self">
<FRAME name=ZhuFrame id=ZhuFrame borderColor=#000000
frameBorder=auto target="_self"></FRAMESET><noframes></noframes>
-->
<body 0px" scroll=no onResize=javascript:parent.tree.location.reload() onload="LoadFrame()" topmargin=0>
<table border="0" cellPadding="0" cellSpacing="0" height="100%" width="100%">
<tr>
<td width="140" align="left" vAlign="center" noWrap id="frmTitle" name="frmTitle">
<iframe frameBorder="1" name="tree" scrolling=auto src="index/index.files/111.htm" 100%; VISIBILITY: inherit; WIDTH: 140px; Z-INDEX: 2">
</iframe></td>
<td 8pt">
<table border="0" cellPadding="0" cellSpacing="0" height="100%" bgcolor=#CCCCCC>
<tr>
<td 100%" onclick="switchSysBar()">
<font 9pt; CURSOR: #000000; COLOR: #666666">


























<span class="navPoint" id="switchPoint" title="关闭/打开导航栏">3</span>











</font></td>
</tr>
</table>
</td>
<td 100%">
<iframe frameBorder="0" name="ZhuFrame" scrolling="yes" src=../../main.htm 100%; VISIBILITY: inherit; WIDTH: 100%; Z-INDEX: 1">
</iframe>
</td>
</tr>
</table>
</html>
<script>
if(window.screen.width<'1024')
{
//如果客户端显示器分辨率(宽)小与1024象素,则隐藏左侧导航;
switchSysBar();
}
</script>





分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: