Dear Groups, I'm developing a widget for Myspace by GWT. I use JSNI to embed the opensocial API relative code.
1. add a listener for my panel; > addListener(new PanelListenerAdapter() { > public void onActivate(Panel panel) { > logWindow.log("recordPanel activated. > callMakeRequest("+_baseUrl+_storeId+")"); > callMakeRequest(thisPanel,_baseUrl,_storeId); > } > }); > } 2.my jsni code > private native void callMakeRequest(Panel thisPanel,String > baseUrl,String storeId) /*-{ > $wnd["recordResponse"] = function(obj) { > [EMAIL PROTECTED] > ::handleResponse(Lcom/magpieradio/client/ui/RecordResponse;)(obj); > }; > var os_param = new Array(); > os_param[gadgets.io.RequestParameters.METHOD] = > gadgets.io.MethodType.GET; > os_param[gadgets.io.RequestParameters.CONTENT_TYPE] = > gadgets.io.ContentType.DOM; > //var url = baseUrl+"data.php?al=0&myspaceid="+storeId; > var url = 'http://www.magpie.fm/~yunhui_song/bandResource.xml'; > gadgets.io.makeRequest(url, recordResponse, os_param); > }-*/; and java-js bridget code public void handleResponse(RecordResponse br) { > logWindow.log("call handleResponse"); > String xmlMsg = br.getRecordListing(); > logWindow.log("xmlMsg="+xmlMsg); > logWindow.log("call refreshByXmlMsg"+xmlMsg); > refreshByXmlMsg(xmlMsg); > } > class RecordResponse extends JavaScriptObject { > // Overlay types always have protected, zero-arg ctors > protected RecordResponse() { > } > > public final native String getRecordListing() /*-{ > return this.text; > }-*/; > } > I use a debug window to display the output on myspace, alert() doesn't work on myspace. I told me everything is ok in FireFox3, but When I tested in other browsers(IE, Chrome,Opera and Safari), this method doesn't work. gadgets.io.makeRequest(url, recordResponse, os_param); In chrome and Safari I got the error message: > Refused to set unsafe header Content-length > Refused to set unsafe header Connection After reading documentation from myspace reference and opensocial API reference in more detail, I don't found any clue about the problem. Has anybody faced the similiar case? any suggestion is welcome. Thanks in advance. Sammi --~--~---------~--~----~------------~-------~--~----~ 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 [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/Google-Web-Toolkit?hl=en -~----------~----~----~----~------~----~------~--~---