This issue can be solved by opening and closing the iframe document once. It seems that some browsers need to initialize the content document of an iframe before it can be used to resolve url fragments.
var iframe = document.createElement('iframe');
document.body.appendChild(iframe);
iframe.contentDocument.open();
iframe.contentDocument.close();
从stackover上找到了解决方法:
This issue can be solved by opening and closing the iframe document once. It seems that some browsers need to initialize the content document of an iframe before it can be used to resolve url fragments.
http://stackoverflow.com/questions/10177190/svg-dynamically-added-to-iframe-does-not-render-correctly