Hey Thanks for the feedback everyone.
Anton, adding that script before the close of the body tag doesn't
seem to change anything in my test case. That ticket you linked to
does appear to differ from my case though as I don't see any svg
content at all, whereas that one still shows content albeit static.
Whilst their sample code is using the .svg() constructor it is simpler
one line tags all of which are added as children of an empty
SVGElement constructed without any string parsing so the use case
appears to differ a bit.
Ruud and Mike, I don't think that .tag() is going to satisfy my use
case as it implies drawing the rest of the SVG element
programmatically piece by piece. I need for the user to be able to
select from a list of svg files and then have the selected one
display. Figured I'd use a HTTP request to load the selected svg as
plain text and then have the .svg() constructor parse the string,
sound reasonable enough or am I architecting it wrong?
Thanks for the link to
http://code.google.com/p/dart/issues/detail?id=772,
has given me a working solution for now.
svgElement = new Element.tag('div');
svgElement.innerHTML = """
""";
Gives me a valid element that displays the svg correctly, parsed from
a string too. Should allow me to achieve the desired functionality I
mentioned earlier.
Very new to Dart, any feedback greatly appreciated.
Thanks,
Tim
> SVG should work, but be aware ofhttp://
code.google.com/p/dart/issues/detail?id=2856
>
> Roughly, please add <script>navigator.webkitStartDart()</script> right
> before you close document body (yes, it's ugly).
>
> If you still see some problems, please, let us know.
>
> Happy darting!
>
> yours,
> anton.
>
>
>
>
>
>
>
> On Fri, May 4, 2012 at 2:23 AM, Tim <
timothydd...@gmail.com> wrote:
> > I'm trying to use the svg constructor but with no luck so far.
>
> > I'm attempting to construct an svg element like so:
>
> > var svg = new SVGElement.svg("""
> > <svg xmlns="
http://www.w3.org/2000/svg"
> > version="1.1"
> > ...
> > </svg>
> > """);
>
> > Code taken from:
https://code.google.com/p/dart/source/browse/trunk/dart/samples/logo/...