欢迎光临
我们一直在努力

JavaScript中获得地址栏参数QueryString-JSP教程,Java技巧及代码

建站超值云服务器,限时71元/月

<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>

赞(0)
版权申明:本站文章部分自网络,如有侵权,请联系:west999com@outlook.com 特别注意:本站所有转载文章言论不代表本站观点! 本站所提供的图片等素材,版权归原作者所有,如需使用,请与原作者联系。未经允许不得转载:IDC资讯中心 » JavaScript中获得地址栏参数QueryString-JSP教程,Java技巧及代码
分享到: 更多 (0)

相关推荐

  • 暂无文章