0

I'm trying to implement onLoadErrorFn in my host file when loading gwt application. I'm not certain how it should be done. http://my.safaribooksonline.com/book/web-development/gwt/9781933988290/quick-reference/app02lev1sec3

Parts of my host file:

<html>
   <head>
      <meta name="gwt:onLoadErrorFn" content="onGwtModuleLoadError"/>
      <script type="text/javascript" src="..../>
      <script type="text/javascript" src="..../>
      <script type="text/javascript">
          function onGwtModuleLoadError(message) {
             alert("onGwtModuleLoadError(" + message + ")");
          }
      </script>

When I run the host page I get the error: Bad handler for "onGwtModuleLoadError" for "gwt:onLoadErrorFn"

4

1 回答 1

0

I've found the problem. I updated the code example since I had two included javascripts declared before my function. When I shuffled around it worked:

<html>
<head>
  <meta name="gwt:onLoadErrorFn" content="onGwtModuleLoadError"/>
  <script type="text/javascript">
      function onGwtModuleLoadError(message) {
         alert("onGwtModuleLoadError(" + message + ")");
      }
  </script>
  <script type="text/javascript" src="..../>
  <script type="text/javascript" src="..../>
于 2013-10-09T14:09:44.570 回答