<svg xmlns="http://www.w3.org/2000/svg" onload="boom();"> <script type="text/javascript"> function boom() { var path = document.createElementNS("http://www.w3.org/2000/svg", "path"); path.getPathSegAtLength(1); } </script> </svg>