I want to create svg using javascript in IE9, so I used document.craeteElementNS method. It works fine in other browser but not IE9. Can I know Why? Here is a documentation that state the method should work with IE9,
http://msdn.microsoft.com/en-us/library/ie/ff975213%28v=vs.85%29.aspx
But when I tried it out, it doesn't, may I know why?
Result: It doesn't shows the polygon on the page that it should be, it just convey a blank page
<html>
<head>
<script src="http://code.jquery.com/jquery-1.10.2.js"></script>
<script>
$(window).load(function(){
var myDiv = document.getElementById("myDiv");
var mySVG = document.createElementNS("http://www.w3.org/2000/svg", "svg");
mySVG.setAttribute("height","210");
mySVG.setAttribute("width","500")
myDiv.appendChild(mySVG);
var myPolygon = document.createElementNS("http://www.w3.org/2000/svg", "polygon");
myPolygon.setAttribute("style","fill:lime;stroke:purple;stroke-width:1");
myPolygon.setAttribute("points","200,10 250,190 160,210");
mySVG.appendChild(myPolygon);
});
</script>
</head>
<body>
<div id="myDiv">
</div>
</body>
</html>