8. Mixing in JavaScript

JavaScript is to GWT what assembly language is to classic compilers, and although you should be careful, mixing JavaScript in with your Java code can help. For example, you can attain better performance, or achieve otherwise hard-to-get results, including getting data from remote servers bypassing the Same Origin Policy we covered in previous chapters.

There are some circumstances when you will need to add some JavaScript to your application, and GWT provides a solution for this kind of situation. The GWT developers frequently use this to get low-level access to browser aspects, but there are other possible usages, such as taking advantage of prewritten JavaScript routines and libraries, using JSON (an alternative to XML) ...

Get Essential GWT: Building for the Web with Google Web Toolkit 2 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.