2007年4月1号,发现点击公告无法弹出窗口。,参考以下代码
<a href="#" onclick="JavaScript:window.open('winamp/winamp/exobud.htm',310,290)"><font color=#FF0000>点歌机</font></a>
对原有代码进行了修改(仅修改了3个openScript()的第一个)。
下面是原来使用openScript()的代码,存在此处,以备将来不时之需。
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml" omit-xml-declaration = "yes" indent="yes" version="4.0"/>
<!--
Copyright (C) 2004,2005 AspSky.Net. All rights reserved.
Written by dvbbs.net Lao Mi
Web: http://www.aspsky.net/,http://www.dvbbs.net/
Email: eway@aspsky.net
论坛公告模板
-->
<xsl:variable name="marquee" select="1"/><!--设置为1则移动公告-->
<xsl:variable name="maxposition" select="5"/><!--移动公告最多显示多少条-->
<xsl:variable name="show" select="1"/><!--方便不想显示公告的家伙,这里做了开关,设置为0则不显示公告-->
<xsl:template match="/">
<xsl:if test="$show=1">
<xsl:variable name="boardid" select="xml/@boardid"/>
<div class="itableborder">
<xsl:choose>
<xsl:when test="xml/news[@boardid=$boardid]">
<xsl:choose>
<xsl:when test="$marquee=1">
<div style="100%;">
<marquee scrolldelay="150" bgcolor="yellow" scrollamount="3" onmouseout="if (document.all!=null)this.start()" onmouseover="if (document.all!=null)this.stop()">
公告:<xsl:for-each select="xml/news[@boardid=$boardid][position() < ($maxposition+1)]"> <a href="javascript:openScript('announcements.asp?boardid={$boardid}',500,400)"><b><xsl:value-of select="@title" disable-output-escaping="yes"/></b></a>(<xsl:value-of select="translate(@addtime,'T',' ')" />) </xsl:for-each>
</marquee>
</div>
</xsl:when>
<xsl:otherwise>
<xsl:if test="xml/news[@boardid=$boardid]/@bgs and xml/news[@boardid=$boardid]/@bgs !=''"><bgsound src="{xml/news[@boardid=$boardid]/@bgs}"/><img src="Skins/Default/filetype/mid.gif" border="0" alt="" /> </xsl:if><a href="javascript:openScript('announcements.asp?action=showone&boardid={$boardid}',500,400)"><b><xsl:value-of select="xml/news[@boardid=$boardid]/@title" disable-output-escaping="yes"/></b></a>(<xsl:value-of select="translate(xml/news[@boardid=$boardid]/@addtime,'T',' ')" />)</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<a href="javascript:openScript('announcements.asp?action=showone&boardid={$boardid}',500,400)"><b>当前还未有公告</b></a>()
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml" omit-xml-declaration = "yes" indent="yes" version="4.0"/>
<!--
Copyright (C) 2004,2005 AspSky.Net. All rights reserved.
Written by dvbbs.net Lao Mi
Web: http://www.aspsky.net/,http://www.dvbbs.net/
Email: eway@aspsky.net
论坛公告模板
-->
<xsl:variable name="marquee" select="1"/><!--设置为1则移动公告-->
<xsl:variable name="maxposition" select="5"/><!--移动公告最多显示多少条-->
<xsl:variable name="show" select="1"/><!--方便不想显示公告的家伙,这里做了开关,设置为0则不显示公告-->
<xsl:template match="/">
<xsl:if test="$show=1">
<xsl:variable name="boardid" select="xml/@boardid"/>
<div class="itableborder">
<xsl:choose>
<xsl:when test="xml/news[@boardid=$boardid]">
<xsl:choose>
<xsl:when test="$marquee=1">
<div style="100%;">
<marquee scrolldelay="150" bgcolor="yellow" scrollamount="3" onmouseout="if (document.all!=null)this.start()" onmouseover="if (document.all!=null)this.stop()">
公告:<xsl:for-each select="xml/news[@boardid=$boardid][position() < ($maxposition+1)]"> <a href="javascript:openScript('announcements.asp?boardid={$boardid}',500,400)"><b><xsl:value-of select="@title" disable-output-escaping="yes"/></b></a>(<xsl:value-of select="translate(@addtime,'T',' ')" />) </xsl:for-each>
</marquee>
</div>
</xsl:when>
<xsl:otherwise>
<xsl:if test="xml/news[@boardid=$boardid]/@bgs and xml/news[@boardid=$boardid]/@bgs !=''"><bgsound src="{xml/news[@boardid=$boardid]/@bgs}"/><img src="Skins/Default/filetype/mid.gif" border="0" alt="" /> </xsl:if><a href="javascript:openScript('announcements.asp?action=showone&boardid={$boardid}',500,400)"><b><xsl:value-of select="xml/news[@boardid=$boardid]/@title" disable-output-escaping="yes"/></b></a>(<xsl:value-of select="translate(xml/news[@boardid=$boardid]/@addtime,'T',' ')" />)</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<a href="javascript:openScript('announcements.asp?action=showone&boardid={$boardid}',500,400)"><b>当前还未有公告</b></a>()
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
上文中共出现3次openScript(), 将第一次出现的openScript()替换为window.open()变为下面的代码
<?xml version="1.0" encoding="gb2312"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml" omit-xml-declaration = "yes" indent="yes" version="4.0"/>
<!--
Copyright (C) 2004,2005 AspSky.Net. All rights reserved.
Written by dvbbs.net Lao Mi
Web: http://www.aspsky.net/,http://www.dvbbs.net/
Email: eway@aspsky.net
论坛公告模板
-->
<xsl:variable name="marquee" select="1"/><!--设置为1则移动公告-->
<xsl:variable name="maxposition" select="5"/><!--移动公告最多显示多少条-->
<xsl:variable name="show" select="1"/><!--方便不想显示公告的家伙,这里做了开关,设置为0则不显示公告-->
<xsl:template match="/">
<xsl:if test="$show=1">
<xsl:variable name="boardid" select="xml/@boardid"/>
<div class="itableborder">
<xsl:choose>
<xsl:when test="xml/news[@boardid=$boardid]">
<xsl:choose>
<xsl:when test="$marquee=1">
<div style="100%;">
<marquee scrolldelay="150" bgcolor="yellow" scrollamount="3" onmouseout="if (document.all!=null)this.start()" onmouseover="if (document.all!=null)this.stop()">
公告:<xsl:for-each select="xml/news[@boardid=$boardid][position() < ($maxposition+1)]"> <a href="#" onclick="javascript:window.open('announcements.asp?boardid={$boardid}','','')"><b><xsl:value-of select="@title" disable-output-escaping="yes"/></b></a>(<xsl:value-of select="translate(@addtime,'T',' ')" />) </xsl:for-each>
</marquee>
</div>
</xsl:when>
<xsl:otherwise>
<xsl:if test="xml/news[@boardid=$boardid]/@bgs and xml/news[@boardid=$boardid]/@bgs !=''"><bgsound src="{xml/news[@boardid=$boardid]/@bgs}"/><img src="Skins/Default/filetype/mid.gif" border="0" alt="" /> </xsl:if><a href="javascript:openScript('announcements.asp?action=showone&boardid={$boardid}',500,400)"><b><xsl:value-of select="xml/news[@boardid=$boardid]/@title" disable-output-escaping="yes"/></b></a>(<xsl:value-of select="translate(xml/news[@boardid=$boardid]/@addtime,'T',' ')" />)</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<a href="javascript:openScript('announcements.asp?action=showone&boardid={$boardid}',500,400)"><b>当前还未有公告</b></a>()
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:if>
</xsl:template>
</xsl:stylesheet>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >
<xsl:output method="xml" omit-xml-declaration = "yes" indent="yes" version="4.0"/>
<!--
Copyright (C) 2004,2005 AspSky.Net. All rights reserved.
Written by dvbbs.net Lao Mi
Web: http://www.aspsky.net/,http://www.dvbbs.net/
Email: eway@aspsky.net
论坛公告模板
-->
<xsl:variable name="marquee" select="1"/><!--设置为1则移动公告-->
<xsl:variable name="maxposition" select="5"/><!--移动公告最多显示多少条-->
<xsl:variable name="show" select="1"/><!--方便不想显示公告的家伙,这里做了开关,设置为0则不显示公告-->
<xsl:template match="/">
<xsl:if test="$show=1">
<xsl:variable name="boardid" select="xml/@boardid"/>
<div class="itableborder">
<xsl:choose>
<xsl:when test="xml/news[@boardid=$boardid]">
<xsl:choose>
<xsl:when test="$marquee=1">
<div style="100%;">
<marquee scrolldelay="150" bgcolor="yellow" scrollamount="3" onmouseout="if (document.all!=null)this.start()" onmouseover="if (document.all!=null)this.stop()">
公告:<xsl:for-each select="xml/news[@boardid=$boardid][position() < ($maxposition+1)]"> <a href="#" onclick="javascript:window.open('announcements.asp?boardid={$boardid}','','')"><b><xsl:value-of select="@title" disable-output-escaping="yes"/></b></a>(<xsl:value-of select="translate(@addtime,'T',' ')" />) </xsl:for-each>
</marquee>
</div>
</xsl:when>
<xsl:otherwise>
<xsl:if test="xml/news[@boardid=$boardid]/@bgs and xml/news[@boardid=$boardid]/@bgs !=''"><bgsound src="{xml/news[@boardid=$boardid]/@bgs}"/><img src="Skins/Default/filetype/mid.gif" border="0" alt="" /> </xsl:if><a href="javascript:openScript('announcements.asp?action=showone&boardid={$boardid}',500,400)"><b><xsl:value-of select="xml/news[@boardid=$boardid]/@title" disable-output-escaping="yes"/></b></a>(<xsl:value-of select="translate(xml/news[@boardid=$boardid]/@addtime,'T',' ')" />)</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<a href="javascript:openScript('announcements.asp?action=showone&boardid={$boardid}',500,400)"><b>当前还未有公告</b></a>()
</xsl:otherwise>
</xsl:choose>
</div>
</xsl:if>
</xsl:template>
</xsl:stylesheet>