【发布时间】:2011-02-15 10:15:43
【问题描述】:
javascript:如何在 HTML img 元素支持中检测 SVG?
我试过了,但它不起作用:
x = new Image();
x.onload = function(){
if (x.width) {
alert('svg in img tag supported!');
}
};
x.src = 'test.svg';
【问题讨论】:
-
不重复,这里我回答“img 标签中的 svg”,而不是“html5 中的内联 svg”
标签: javascript svg detect