<script type="text/javascript">
<![CDATA[
function mout() { alert(st1);
}
]]>
</script>
<object id="svg_obj" type="image/svg+xml" width="100%" height="80%" data="example_1.svg">
Your browser is currently unable to display SVG images.
</object> //在example_1.svg 中 嵌入 java script st1="hello world";
<object id="svg_obj" type="image/svg+xml" width="100%" height="80%" data="example_2.svg">
Your browser is currently unable to display SVG images.
</object> //在example_2.svg 的一个mouseout事件中 mouseout=mout() 返回helloworld的字符串 如何实现呢
<![CDATA[
function mout() { alert(st1);
}
]]>
</script>
<object id="svg_obj" type="image/svg+xml" width="100%" height="80%" data="example_1.svg">
Your browser is currently unable to display SVG images.
</object> //在example_1.svg 中 嵌入 java script st1="hello world";
<object id="svg_obj" type="image/svg+xml" width="100%" height="80%" data="example_2.svg">
Your browser is currently unable to display SVG images.
</object> //在example_2.svg 的一个mouseout事件中 mouseout=mout() 返回helloworld的字符串 如何实现呢
解决方案 »
- javascript实现的checkbox
- 关于使用Google地图api在ie下的问题
- 这样的问题怎样实现?
- 怎么在Web页面中实现像支付宝、招行那样的基于控件加密的用户名密码框?
- 请问,为什么梅花雪树我用的有问题呀?老是说MzTreeView没定义,我把js文件包含进去了呀
- 点击按钮后弹出一个层,现在的问题是 ,如何在层之外的任何地方点击后,层就消失。
- 高分请教关于网站的维护的方式
- 怎样判断iframe中的文件已经加载完成?
- 如何调用FileSystemObject
- 谁知道怎样用javascript实现类似vb或java中的表格控件,本人需要,非常急!
- Jquery如何实现菜单点击消失?
- 难道自动上传本地文件真的没办法?也就是说能粘贴图片自动上传的富文本编辑器不可行?
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src='common.js'></script>
</head>
<body>
<script>
a('b');
</script>
</body>
</html>
a页面:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title></title>
<script src='common.js'></script>
</head>
<body>
<script>
a('a');
</script>
</body>
</html>
共用js:
function a(value) {
alert(value);
}
没弄过svg,我想也应该差不多
输入文件名后确定,即添加了一个js文件,写入代码保存
也可以用文本文件,后缀名改为.js页面上引用方式:
<script type="text/javascript" src="../js/WebBase.js" ></script>src 即js文件在项目内的路径引用该js文件等效于在页面该位置添加了文件内的代码