急急急!!! SVG 中如何打开一个链接????

LuckyJan 2007-02-08 09:40:40
<svg>
<g id="moreAlarmG" onclick="showMoreAlarm()" ><text x="160" y="14" class="morealarm">aaa</text></g>
</svg>


============= javascript =============
function showMoreAlarm(){
//类似 window.open("a.htm");
//SVG中怎么打开????
}
...全文
392 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
gavinteng010 2007-04-18
  • 打赏
  • 举报
回复
..
孟子E章 2007-02-08
  • 打赏
  • 举报
回复
换成
<script type="text/javascript">
也可以
孟子E章 2007-02-08
  • 打赏
  • 举报
回复
<svg>
<script type="text/ecmascript">
<![CDATA[
var xlinkNS = "http://www.w3.org/1999/xlink";
var someLinks = "http://dotnet.aspx.cc";
function OpenNewWindow()
{
try
{
window.open(someLinks);
}
catch (er)
{
browserEval("window.open('" + someLinks + "')");
}
}
function alternativeOpenWindow(evt,url)
{
evt.target.parentNode.setAttributeNS(xlinkNS,"href",url);
}
]]>
</script>
<g id="moreAlarmG" onclick="OpenNewWindow()" ><text x="160" y="14">Open Window</text></g>
</svg>
孟子E章 2007-02-08
  • 打赏
  • 举报
回复
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink">
<script type="text/ecmascript">
<![CDATA[
var xlinkNS = "http://www.w3.org/1999/xlink";
var someLinks = "http://dotnet.aspx.cc";
function showMoreAlarm() {
try {
window.open(someLinks);
}
catch (er) {
browserEval("window.open('"+someLinks+"')");
}
}
function alternativeOpenWindow(evt,url) {
evt.target.parentNode.setAttributeNS(xlinkNS,"href",url);
}
]]>
</script>
<g id="moreAlarmG" onclick="showMoreAlarm()" ><text x="160" y="14" class="morealarm">Open Window</text></g>
</svg>

110,538

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧