svgdotjs / svg.js

The lightweight library for manipulating and animating SVG
https://svgjs.dev
Other
11.17k stars 1.08k forks source link

TypeError: this.parent is null svg.js:2592:0 #348

Closed alevlako closed 9 years ago

alevlako commented 9 years ago

Hi, wout! On first example I am receiving a following error message in console :(

if (SVG.supported) {
  var draw = SVG('drawing')
  var rect = draw.rect(100, 100)
} else {
  alert('SVG not supported')
}
Fuzzyma commented 9 years ago

You may have noticed that there is a magic param when you initialize SVG:

var draw = SVG(**'drawing'**)

This is the id of the element where the SVG is placed. It throws an error when there is no element with this id

alevlako commented 9 years ago

Thank you, Fuzzyma! I'm very inconsiderate after a working day and I am a new in js... ) Now I have a chance to play with my big svg and remake all animations from SMIL to the lib! Good news. Yes!