JavaScript函数document.createElementNS()
在旧版本的IE(6,7,8)中无法使用?是否有兼容此函数的代码,类似于Array
的兼容map函数用于旧版IE?
JavaScript函数document.createElementNS()
在旧版本的IE(6,7,8)中无法使用?是否有兼容此函数的代码,类似于Array
的兼容map函数用于旧版IE?
window.onload = function() {
function onCreateElementNsReady(func) {
if (document.createElementNS != undefined) {
func();
} else {
setTimeout(function() { onCreateElementNsReady(func); }, 100);
}
}
onCreateElementNsReady(function() {
var svg = document.createElementNS(svgns, 'svg');
// ...
});
};