Hi

Am not able to get data from server using cross site communication. Below is
my function to connect to the server.
The code is not able to create the callback function on the window object.

Could someone please let me know what is wrong with my code?

Regards
Hlun
====================================================================

public native static void getJsonForFrontPage(int requestId, String url,
      Mysote handler) /*-{
     var callback = "callback" + requestId;


   // [1] Create a script element.

   var script = document.createElement("script");
   script.setAttribute("src", url+callback);
   script.setAttribute("type", "text/javascript");

   // [2] Define the callback function on the window object.
   window[callback] = function(jsonObj) {
   // [3]
   //welcome.add(new HTML("welcome msg 1"));

     handl...@com.mysite.ebcwebsite.client.bangalore
::handleJsonResponse(Lcom/google/gwt/core/client/JavaScriptObject;)(jsonObj);

     window[callback + "done"] = true;
   }

   // [4] JSON download has 1-minute timeout.
   setTimeout(function() {
     if (!window[callback + "done"]) {

       handl...@com.bangalore.ebcwebsite.client.bangalore
::handleJsonResponse(Lcom/google/gwt/core/client/JavaScriptObject;)(null);
      }

     // [5] Cleanup. Remove script and callback elements.
     document.body.removeChild(script);
     delete window[callback];
     delete window[callback + "done"];
   }, 100000);

   // [6] Attach the script element to the document body.
   document.body.appendChild(script);
  }-*/;

--~--~---------~--~----~------------~-------~--~----~
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