External JS in GWT

79 views
Skip to first unread message

Lourival Junior

unread,
Oct 8, 2007, 2:49:19 PM10/8/07
to Google Web Toolkit
Hi group!

I'm trying to include a external JS file (prototype framework) in my
gwt application but I'm getting problems. I tried many ways to do it
like include the script file in header section of the host page before
the script nocache.js and using Automatic Resource Inclusion,
described here
http://code.google.com/webtoolkit/documentation/com.google.gwt.doc.DeveloperGuide.Fundamentals.Modules.AutomaticResourceInjection.html,
but I always get a error.

Have anyone had successful include prototype framework without errors?

Regards,

cres...@gmail.com

unread,
Oct 9, 2007, 1:06:37 PM10/9/07
to Google Web Toolkit
On Oct 8, 11:49 am, Lourival Junior <junior.u...@gmail.com> wrote:
> Have anyone had successful include prototype framework without errors?

I've incorporated external javascript with the <script ...> tag in my
gwt.xml as described in the automatic resource inclusion page without
problems (well, I always forget that the methods must be qualified
with $doc or $win when you invoke them in JSNI methods, but other than
that I haven't had problems.)

What error are you getting?

--Rogan

Lourival Junior

unread,
Oct 11, 2007, 7:20:17 AM10/11/07
to Google Web Toolkit
Yeah! I've noted that to use external libraries in gwt you must
include $wnd before any function you call. However, this I can't found
anything about this in JSNI documentation :(. For example if you want
to use the $() function you must call like this: $wnd.$
('wait').show();

Thanks!

On Oct 9, 2:06 pm, "cresw...@gmail.com" <cresw...@gmail.com> wrote:
> On Oct 8, 11:49 am, Lourival Junior <junior.u...@gmail.com> wrote:
>

> > Have anyone had successful includeprototypeframework without errors?

Sumit Chandel

unread,
Oct 11, 2007, 1:28:05 PM10/11/07
to Google-We...@googlegroups.com
Hi Lourival,

I agree, there should be better documentation explaining how to use external JavaScript in JSNI. Specifically, there should be explicit documentation on this subject in the Developer Guide under the JavaScript Native Interface section.

I have created the Issue #1762 (link below) to make sure this gets addressed in a future release of GWT documentation.

http://code.google.com/p/google-web-toolkit/issues/detail?id=1762

Thanks,
-Sumit Chandel
Reply all
Reply to author
Forward
0 new messages