Wednesday, February 26, 2014

Re: GWT and SVG, the 125th... :-)

But when call testSVG I get the following error: (ReferenceError) @wgp.client.lib.GraphicsPanel::test()([]): SVG is not defined

You have added a <script> element to the browser's top window, but your GWT app runs inside an iframe. Inside that GWT iframe you can not access "SVG" directly, you have to write "$wnd.SVG". "$wnd" is created by GWT and always points to the browsers top window.

I think it is better to use GWT's ScriptInjector class instead of creating a <script> element yourself. ScriptInjector injects JavaScript code into the same iframe in which your GWT app runs by default. But you can tell ScriptInjector to inject to the top window if needed.

-- J.

You received this message because you are subscribed to the Google Groups "Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email to
To post to this group, send email to
Visit this group at
For more options, visit

No comments:

Post a Comment