如何调用SVG中的script ? ADOBE说SVG plugin不支持打印,可我却发现用IE可以打印:)方法是:在IE中进入“打印预览”,能看见就可以打印了。你知道为什么IE能打印SVG ? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 这样肯定不行啦!应该是多次定义了函数。其实你可以把svg中的call_out()放在html啊!就是下面这样:-------------------主页面----------------------<html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>test svg</title></head><script language="JavaScript" type="text/JavaScript"> function call_out(id) { alert("called from svg=" + id); } </script><body><embed src="a.svg" width="400" height="20" align="top" name="svg_1" type="image/svg+xml" /><input name="ok" type="button" value="callSVG" onclick="call_in(1111);"></body></html>-------------------a.svg----------------------<?xml version="1.0" encoding="UTF-8"?><svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 20" height="20" width="400" id="body"><rect x="300" y="0" width="25%" height="100%" style="fill:rgb(255,0,0);stroke:rgb(0,0,0);stroke-width:1" onclick="call_out(111);"/></svg> IE能打印SVG ,我觉得主要是因为ie把它当成普通的embed对象了啊! iframe.name和iframe的window.name是不是一个东西? JS 给table外面加层DIV Google出了替代ajax的技术 jsp图片提交表单问题 如何让定时器不停来 分享:Javascript内置方法十分方便的进行数值进制转换 insertRow,insertCell以及deleteRow在mozilla,netscape等浏览器上怎么用? 分享我写的上传图片本地预览插件 请教个在网页中加载有控制条的swf播放器的问题! 急!如何在一个frame中得到其当前页面的URL 如何判断框架页面超时后返回首页 用js 在span指定的位置放入一串字符,如何实现?
其实你可以把svg中的call_out()放在html啊!就是下面这样:
-------------------主页面----------------------<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>test svg</title>
</head><script language="JavaScript" type="text/JavaScript"> function call_out(id)
{
alert("called from svg=" + id);
}
</script><body>
<embed src="a.svg" width="400" height="20" align="top" name="svg_1" type="image/svg+xml" /><input name="ok" type="button" value="callSVG" onclick="call_in(1111);">
</body>
</html>-------------------a.svg----------------------<?xml version="1.0" encoding="UTF-8"?><svg xmlns:xlink="http://www.w3.org/1999/xlink" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 400 20" height="20" width="400" id="body">
<rect x="300" y="0" width="25%" height="100%" style="fill:rgb(255,0,0);stroke:rgb(0,0,0);stroke-width:1" onclick="call_out(111);"/></svg>