Hi,

First, when you want to access variables and functions from JSNI that
are outside of the GWT code you must use the $wnd. prefix, for example
to run the JavaScript alert() function from JSNI you would write
$wnd.alert('something');
Second, you may be trying to call external JavaScript functions or
access DOM elements before the external script or DOM were fully
loaded. In such a case wrapping the call to the JSNI method with a
ScheduledCommand or a Timer may help. Try these:
Scheduler.get().scheduleDeferred(new ScheduledCommand() {
   public void execute() {
      // call JSNI method here
   }
}
or
new Timer() {
   public void run() {
      // call JSNI method here
   }
}.schedule(100); // play with the number of milliseconds
I recommend trying the ScheduledCommand first - when you use it in
scheduleDeferred(), it will be called after all other browser
operations have been finished. In my experience you should check early
if whatever solution that works in development mode also works in
compiled mode, you may get different behavior sometimes, for example
you would need to use a different period of time before you can call
external JavaScript.

On May 26, 2:21 pm, maq <mumay...@gmail.com> wrote:
> Hi,
>
> I tried to use GWT HTML widget to include a third party widget such
> as  javascript code for Expedia banner. It doesn't seem always working
> when I test it. If the same javascript is directly put in the static
> HTML host page, it always works.
>
> Has anyone seen similar problem?
>
> - maq

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to google-web-toolkit@googlegroups.com.
To unsubscribe from this group, send email to 
google-web-toolkit+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to