Hi,

I've tried to start a simple syncronous httprequest in the Android
Browser but it results in an error ( browser crashes ) while sending
the request ( httpreq.send(null); ). I ve got to kill the Browser-
process to continue.

I also tried async, with/without posts but nothing works.

Is there any way to get the error?? Any javascript-debuggers?
Does anyone know whats goeing wrong? Code works on IPhone, FF2, FF3,
IE6,7,8, WM6

code:

V7{
  reqNo : 0,
  getSync : function( url ){
    var httpS_request = false;
    var res = '';
    if( window.XMLHttpRequest ){ // Mozilla, Safari,...
      httpS_request = new XMLHttpRequest();
      if( httpS_request.overrideMimeType ){
      }
    }else if( window.ActiveXObject ){ // IE
      try{
        httpS_request = new ActiveXObject("Msxml2.XMLHTTP");
      }catch( e ){
        try{
          httpS_request = new ActiveXObject("Microsoft.XMLHTTP");
        }catch( e ){}
      }
    }
    if( !httpS_request ){
      alert('Cannot create XMLHTTP instance');
      return false;
    }
    var tmpUrl = "XXXXXX&reqNo=" + (V7.reqNo++);
    tmpUrl += url;
    httpS_request.open('GET', tmpUrl, false);
    httpS_request.setRequestHeader("Content-type", "application/x-www-
form-urlencoded");
    if( httpS_request.overrideMimeType ){
      httpS_request.overrideMimeType('charset=utf-8');
    }
// #### Here it crashes  ################
    httpS_request.send(null);
    res = httpS_request.responseText;
    delete httpS_request;
    return res;
  }
}

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google
Groups "Android Developers" 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/android-developers?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to