Opened 10 years ago
Closed 10 years ago
#13646 closed bug (wontfix)
jQuery does not bind SVG elements to the SVG namespace
Reported by: | Owned by: | ||
---|---|---|---|
Priority: | undecided | Milestone: | None |
Component: | unfiled | Version: | 2.0b2 |
Keywords: | Cc: | ||
Blocked by: | Blocking: |
Description
When you try to insert SVG elements inside a document, jQuery does not handle the SVG namespace, therefor they are not recognized by the browser and not render.
Only a tree with an <svg> element is properly handled. The following work as expected:
$('body').append('<svg width="100px" height="100px"><circle cx="50" cy="50" r="39" fill="red" /></svg>');
Unfortunately, if you try to insert a element outside of an explicit <svg> element, it fail. The following does not work as expected
$('svg').append('<circle cx="50" cy="50" r="40" fill="green" />');
A live example of that issue is available on jsFiddle : http://jsfiddle.net/rVMKR/
http://docs.jquery.com/Won't_Fix#SVG.2FXML.2FVML_Bugs