javascript中获得地址栏参数QueryString


<HTML><HEAD><TITLE>都市女孩社区</TITLE>
<META http-equiv=Content-Type content=text/HTML;charset=gb2312>
<LINK href=../../"scrool.CSS" type=text/CSS rel=stylesheet>
<style type="text/CSS">
.navPoint
{
COLOR: #444444; CURSOR: hand; FONT-FAMILY: Webdings; FONT-SIZE: 9pt
}
</style>
<script language=javascript>
function GetQueryvalue(sorStr,panStr)
{
/*++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

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

CreatDate: 2004-02-28
AuthorName:: WuMeibo wumeibo@joysos.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 wumeibo@joysos.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.href=../../"index/index.files/111.htm";
}
else
{ //刷新左侧导航条为DJ大联盟;
tree.location.href=../../"index/index.files/222.htm";
}

url="main.htm?forum="+forum+"&topic="+topic;
ZhuFrame.location.href=../../url;

}
</script>
<script>
if(self!=top)
{

top.location=self.location;
}
function 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 武眉博 wumeibo@joysos.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 style="MARGIN: 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" style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 140px; Z-INDEX: 2">
</iframe></td>
<td style="WIDTH: 8pt">
<table border="0" cellPadding="0" cellSpacing="0" height="100%" bgcolor=#CCCCCC>
<tr>
<td style="HEIGHT: 100%" onclick="switchSysBar()">
<font style="FONT-SIZE: 9pt; CURSOR: #000000; COLOR: #666666">
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<br>
<span class="navPoint" id="switchPoint" title="关闭/打开导航栏">3</span><br>
<br>
<br>
<br>
<br>
<br>
</font></td>
</tr>
</table>
</td>
<td style="WIDTH: 100%">
<iframe frameBorder="0" name="ZhuFrame" scrolling="yes" src=../../../../main.htm style="HEIGHT: 100%; VISIBILITY: inherit; WIDTH: 100%; Z-INDEX: 1">
</iframe>
</td>
</tr>
</table>
</HTML>
<script>
if(window.screen.width<'1024')
{
//如果客户端显示器分辨率(宽)小与1024象素,则隐藏左侧导航;
switchSysBar();
}
</script>

本文作者:



相关阅读:
Win7解决无法显示缩略图的技巧
SQL Server另类写法代替Like语句
asp.net 验证码生成和刷新及验证
Windows7 录制器工具录制视频的步骤
纯JS半透明Tip效果代码
用Win7的WinRE功能修复系统
asp.net 设置GridView的选中行
减少Linux内核空循环 降低系统能耗技巧
读取TXT文件内容的方法
PHP教程:httpd.conf文件配置
Windows7 库功能把文件收藏起来
浏览器CSS Reset的十种方法
PHP编程中for循环的使用方法
Coolite Cool Study 2 同时更新多个Tab
快速导航

Copyright © 2016 phpStudy |