以文本方式查看主题

-  中文XML论坛 - 专业的XML技术讨论区  (http://bbs.xml.org.cn/index.asp)
--  『 XSL/XSLT/XSL-FO/CSS 』  (http://bbs.xml.org.cn/list.asp?boardid=8)
----  老大帮忙看,xsl调用JS文件,能正常调用,急!!  (http://bbs.xml.org.cn/dispbbs.asp?boardid=8&rootid=&id=67611)


--  作者:lightming
--  发布时间:9/24/2008 11:37:00 AM

--  老大帮忙看,xsl调用JS文件,能正常调用,急!!
我在xsl里面的代码是:

查看次数:<script language="JavaScript" src="http://www.pcb.com.cn/func/GetProductView_Qty.asp?Product_NO=0610090512056359" type="text/javascript"></script>

在同一个网站调用这个ASP文件,能正常调用,这段代码写在HTML里面能正常调用
但是写在XSL里面就不能使用,这个ASP文件的作用是统计产品查看次数,并显示查看次数


--  作者:hexun831012
--  发布时间:9/25/2008 10:56:00 AM

--  
1
language="JavaScript"这个不要,为什么。。。标准
2
http://www.pcb.com.cn/func/GetProductView_Qty.asp?Product_NO=0610090512056359
这个我打不开
3
你这段脚本写在哪?HEAD还是BODY,发上来看看
--  作者:Qr
--  发布时间:9/25/2008 12:25:00 PM

--  
在XSL中,无论是内部引用,还是外部引用,脚本有关的代码必须写在HEAD区。
--  作者:hexun831012
--  发布时间:9/25/2008 12:28:00 PM

--  
以下是引用Qr在2008-9-25 12:25:00的发言:
在XSL中,无论是内部引用,还是外部引用,脚本有关的代码必须写在HEAD区。


QR来了,呵呵,内部引用可以放在BODY里的哈,而且可以通过defer来控制执行顺序
以下是W3C原文:
5.16. Scripting Module
The Scripting Module defines elements that are used to contain information pertaining to executable scripts or the lack of support for executable scripts. Elements and attributes included in this module are:

Elements Attributes Minimal Content Model
noscript Common (Heading | List | Block)+
script charset (Charset), defer ("defer"), src (URI), type* (ContentType) PCDATA

When this module is used, the script and noscript elements are added to the Block and Inline content sets of the Text Module. In addition, the script element is added to the content model of the head element defined in the Structure Module.


W 3 C h i n a ( since 2003 ) 旗 下 站 点
苏ICP备05006046号《全国人大常委会关于维护互联网安全的决定》《计算机信息网络国际联网安全保护管理办法》
46.875ms