Reputation: 2073
<object data="abc.svg" width="100" height="100" type="image/svg+xml"></object>
I want get the content of the svg,in javascript,it can be get by obj.contentDocument,how to do this in dart?
Upvotes: 2
Views: 137
Reputation: 351
It seems that you'll have to use JsObject.fromBrowserObject:
<object id="svgImage" data="abc.svg" width="100" height="100" type="image/svg+xml"></object>
ObjectElement svgImage = querySelector('#svgImage');
var contentDoc = new js.JsObject.fromBrowserObject(svgImage)['contentDocument'];
For details see discussion in other SO thread Extending <object> in Dart
Upvotes: 1