IE9에서 javascript를 사용하여 svg를 만들고 싶습니다. 따라서 document.craeteElementNS 메서드를 사용했습니다. IE9가 아닌 다른 브라우저에서는 정상적으로 작동합니다. 왜 그런지 알 수 있습니까? 다음은 IE9에서 메서드가 작동해야한다고 명시한 설명서입니다. http://msdn.microsoft.com/en-us/library/ie/ff975213%28v=vs.85%29.aspx 하지만 시도했을 때 왜 그런지 알 수 있습니까? Result: It doesn't shows the polygon on the page that it should be, it just convey a blank page
document.createElementNS 메서드가 IE9에서 작동하지 않습니다.
<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>
정확히 무슨 "작동하지 않습니다"
? 오류가 있습니까? 뭐가 문제 야? "작동하지 않는다"는 정보를 전혀 전달하지 않기 때문에 최악의 오류 설명입니다. 귀하의 코드가 작동하지 않는다는 것은 이미 귀하가 여기 게시 한 것을 의미합니다. –
다각형이 보이지 않으며 페이지에는 아무 것도 없습니다. 죄송합니다. 정보가 부족합니다. – dramasea
문제를 디버깅하기 위해 무엇을 했습니까? –