求助!!!!判断链接是否被点击过,并返回一个值!!!!!急急急急, 我有两个页,判断第一个XSL页中的某个链接是否被人点击过,并返回一个值,用这个值在另一个XSL页中进行判断,来显示不同的页面!!!! 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 点击事件里存储一个值到Hidden field,转到另一个页判断即可 cookie里点一个存一个,下一页读出来就行 本人对javascript是新手,麻烦各位能不能说得明白些,实在不好意思! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><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也只显示它自己的内容.我是新手,请各位能人帮帮忙,尽快. 求不用通过微博发布器点击直接发布微博的代码 DOM(DHTML)与Javascript有什么关系?不好意思,没分了,下次给! 求救~ 高手赐招~! 我想实现当用户点击alert确定按钮后系统自动另外打开一个网页窗口怎样实现呢用其它的方法也行啊,请给出示例代码? 帧-----边界 各位高手帮我解决一下我这个难题? 帮忙解释一下这段代码.谢! 请问<script src="xxx.js">和<!-- #include file="xxx.js"-->有何区别? 请教个正则写法 如何使不同链接,在同一页显示不同的内容?急!!! 在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也只显示它自己的内容.
我是新手,请各位能人帮帮忙,尽快.