Hi folks,
I'm running into a weird issue. I'm using GWT 1.4 final, and
deploying a web application in the 1.4 manner (ie,
<script language="javascript" src="/static/gwt/
com.cohomefinder.gwt.chfgwt.CHFGWT.nocache.js" type="text/
javascript"></script>
I have a variety of components, some of which live in the top nav,
some of which aren't specific in location (ie, set some cookies, or
update some portion of the page).
The issue I'm running into is that on pages with a lot of images, IE6
does not execute the GWT components until the images have all loaded.
I've seen this in IE6, and my client has seen this in IE7--FF2.0 seems
to work just fine. You can see it yourself here:
http://www.cohomefinder.com/browse-ci-Denver-real-estate.htm
(mouseover the 'browse homes' link in the topnav while the home images
are still being loaded, and you'll see it does nothing for a time,
then, when all images are loaded, you should see a popup). The images
are served from a different server.
Currently, the GWT script is at the very bottom of the page. I tried
putting it in various locations--in the header, just after the body
tag, just before the images are called. In each of these situations,
I recieved an 'Operation Aborted' error. I've seen this before when
javascript is trying to modify the DOM before the DOM is complete.
(I've only seen this on IE6, since that's what I'm testing against.)
The very first time the page is viewed with the script in a different
position, I get no error and the GWT component appears to execute
before the images are loaded (if I put it before the images section).
The plan is to defer as much network chatter (of which the GWT
component does a fair bit) until needed. But I'm not sure that's the
solution, as when I view a page with Fiddler (a proxy for IE) enabled,
the GWT component isn't even downloaded every time (I'm guessing it's
cached). It just doesn't seem like the GWT javascript gets executed
before the images are all downloaded. It's like IE6 defers processing
the javascript until the images are all loaded, or doesn't even reach
the javascript until the images are requested. Another possible
solution would be to create DNS aliases such that IE could kick off
the download of each image from a different hostname, and then get to
the javascript.
I looked around the issue tracker and the google group, but didn't
find anything quite applicable. I did find this set of postings about
the placement of the 'nocache.js' script call:
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/a0b377ccdf901aac/8aa78797f087a47a
but, as outlined above, moving the GWT script around broke other
things.
From a couple of pages I've found (
http://channel9.msdn.com/ShowPost.aspx?PostID=215369
), it appears that 'Operation Aborted' occurs when javascript modifies
a table cell. One of the components has RootPanels in a table cell.
But even when I remove the surrounding table, I still get the
'Operation Aborted' message intermittantly. And I don't get the
'Operation Aborted' message when the GWT javascript is the last tag
before </body>
So, the main question is:
What is the fastest way to get the GWT component executed on IE,
preferably before images start downloading. I'd like some of these
components to be available as soon as the user can see their
RootPanel. I assume, like any other javascript, execution is directly
related to the location on the page, and that progressive rendering
will cease while the GWT javascript is being executed.
Is there any way to defer image loading so that the GWT component can
execute quickly? (I looked at an ecmascript reference
http://www.devguru.com/Technologies/ecmaScript/quickref/image.html and
it didn't have any way to do so.)
Or is my best bet to comb through the GWT code and remove dynamic
creations of elements in tables such that I can place it just before
the body tag and not get the 'Operation Aborted' error?
Anyone else deal with these issues?
Thanks,
Dan