我有两个页,判断第一个XSL页中的某个链接是否被人点击过,并返回一个值,用这个值在另一个XSL页中进行判断,来显示不同的页面!!!!
解决方案 »
- 正则表达式的“\W”问题
- blur中可以focus么
- URL调用js的具体方法
- checkbox全选问题
- 帮我看一下,我什么会出现out of memory at line:39错误!!
- 求scriptx.cab空件 希望版本号是5,60,0360
- 请问js如何在<style>与</style>之间增加新样式或删除已存在样式呢??
- !!!晕啊,难道没人知道了,第三次提问关于ALERT(xx.length)的结果是object!!!分不够再给
- 一个级联list的onchange事件的处理函数,帮小妹看看哪里出错了?
- 如何判断页面已经最大化了?
- 如何使不同链接,在同一页显示不同的内容?急!!!
- 在FCKeditor中另外添加自己的js验证出了问题
<html>
<head>
<title> New Document </title>
<meta name="Generator" content="EditPlus">
<meta name="Author" content="zourinet">
<meta name="Keywords" content="">
<meta name="Description" content="">
</head><body>
<script language="JavaScript">
<!--
function Cookies()
{
this.name;
this.path="/";
expires=new Date();
expires.setTime(expires.getTime()+(86400*365));
this.expires = expires.toGMTString();
}
Cookies.prototype.SetCookie=function (name,value)
{
document.cookie=name+"="+value+"; expires="+this.expires+"; path="+this.path+"";
}
Cookies.prototype.getCookie=function (Name)
{
var search = Name + "=";
if (document.cookie.length > 0)
{ // if there are any cookies
offset = document.cookie.indexOf(search)
if (offset != -1)
{ // if cookie exists
offset += search.length ;
end = document.cookie.indexOf(";", offset)
if (end == -1)
end = document.cookie.length;
return (unescape(document.cookie.substring(offset, end)));
}
}
return 0;
}//未完等等[20070825]
Cookies.prototype.getCookieDic=function(vparent,vchildren)
{
var strchildren = this.getCookie(vparent);
strchildren = strchildren.getQuery(vchildren);
return (strchildren);////20070827 完成
}
String.prototype.getQuery = function(name)
{
var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
var r = this.substr(this.indexOf("\?")+1).match(reg);
if (r!=null) return unescape(r[2]); return null;
}
var c = new Cookies();
c.SetCookie("clickclass","isclick=true&numclick=100");
alert(c.getCookieDic("clickclass","isclick"));
//-->
</script>
</body>
</html>
存cookies吧.
myxml.xml
<?xml version="1.0" encoding="utf-8"?>
<chxml title="我的XML">
<detail id="001" hname="XML">
<con id="101" task="AA">
<explain>内容提要
</explain>
</con>
<con id="102" task="BB">
<explain>介绍内容
</explain>
</con>
</detail>
</chxml>
myxsl.xsl
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:copyRight="http://xml.sz.luohuedu.net/" version="1.0">
<xsl:variable name="cols" select="3"/>
<xsl:template match="chxml">
<xsl:apply-templates select="detail"/>
</xsl:template>
<xsl:template match="chxml/detail">
<div id="content">
<xsl:apply-templates select="con"/>
</div>
</xsl:template>
<xsl:template match="chxml/detail/con">
<a href="XSL.htm"><xsl:value-of select="@task" /></a>
<xsl:apply-templates select="explain"/>
</xsl:template>
<xsl:template match="chxml/detail/con/explain">
<xsl:value-of select="."/>
</xsl:template>
</xsl:stylesheet>我想使人按不同的链接时,在XSL.htm中显示不同的内容,如:点击AA就只显示它下面的内容,点击BB也只显示它自己的内容.
我是新手,请各位能人帮帮忙,尽快.