svg javascript開新視窗

來源:互聯網
上載者:User

在svg檔案中,要使用javascript代碼開啟個新視窗好像很麻煩。

第一種方法

<a xlink:href='' target='new'>
<text id='Ali, I.' x='100' y='670' fill='black' font-family='Verdana' font-size='10' onclick='TextonClick(evt)'>Ali, I. </text>
</a>

這個target='new'表示點擊該連結時開啟新視窗,可是在IE,Firefox中都無效

 

第二種方法

用javascript指令碼來實現,

function createWindow(evt)
{
parent.open('pop.html','displaywindow','toolbar=no,width=350,height=400,directories=no,menubar=no,scrollbars=yes,location=no,status=no,scrollbar=yes,resize=no,menubar=no')
}

 

<text id='more' x='100' y='650' fill='black' font-family='Verdana' font-size='10' onclick='createWindow(evt)'>more</text>

這種方法,在firefox中有效,在IE中總是提示permission denied,無許可權。

下面是google上搜到的討論這個問題的文章,

http://topic.csdn.net/u/20070208/09/a2ad9dff-9208-4d2a-be70-43a79de7988c.html

http://wenda.tianya.cn/wenda/thread?tid=5bf84d77aca68c29

http://tech.goodspeed.com.cn/50643.aspx

http://www.nabble.com/window.open-from-SVG-in-IE-ASV-td23763539.html

 

各種方法都有,像什麼parent.open(),

top.open(),可試了都無效。

 

唉,真是麻煩。

 

芝麻大點事情,總是要花n多時間。

 

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.