如何在xml文档中包含Javascript? [英] How to include Javascript in xml-document?

查看:98
本文介绍了如何在xml文档中包含Javascript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这个任务似乎很简单:如何在xml文档中包含一个Javascript文件,以便至少Opera和Firefox可以实际解析它并执行代码?

The task seems to be pretty easy: how to include a Javascript file in xml-document so that at least Opera and Firefox could actually parse it and execute the code?

推荐答案

添加一个说明XHTML命名空间的脚本,它运行得很好。

Add a script stating XHTML namespace, it will run just fine.

<xhtml:script xmlns:xhtml="http://www.w3.org/1999/xhtml"
                src="file.js"
                type="application/javascript"/>

另请参阅
http://www.ibm.com/developerworks/xml/library/x-ffox3/

这篇关于如何在xml文档中包含Javascript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆