Hi,

I try to perform a request from insida a native method. The JS code
works pretty fine when I run it in a standalone html page but inside
the gwt native method the response is empty.
Does anyone have a clue what coud be wrong?

Cheers,
Michael

Here's the code:

private native String fetchStatus(String url) /*-{

                        var xmlHttp = null;
                        // Mozilla, Opera, Safari and Internet Explorer (> v7)
                        if (typeof XMLHttpRequest != 'undefined') {
                            xmlHttp = new XMLHttpRequest();
                        }
                        if (!xmlHttp) {
                            // Internet Explorer 6 or older
                            try {
                                xmlHttp  = new ActiveXObject("Msxml2.XMLHTTP");
                            } catch(e) {
                                try {
                                    xmlHttp  = new 
ActiveXObject("Microsoft.XMLHTTP");
                                } catch(e) {
                                    xmlHttp  = null;
                                }
                            }
                        }
                        if (xmlHttp) {
                            xmlHttp.open('GET', url, true);
                            xmlHttp.onreadystatechange = function () {
                                if (xmlHttp.readyState == 4) {
                                        alert(xmlHttp.responseText);
                                    return xmlHttp.responseText
                                }

                                else {
                                        return null;
                                }
                            };
                            xmlHttp.send(null);
                        }
        }-*/;
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
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
-~----------~----~----~----~------~----~------~--~---

Reply via email to