Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Web and WebWorks Development

Reply
New Developer
Posts: 23
Registered: ‎03-12-2011
My Device: Bold 9700
My Carrier: Tigo

Ajax Problem in BB Torch

Hi.

 

I have a widget that uses Ajax.  My widget works fine in 5.0 OS, but when tray in BB Torch the aplication crash.

 

I've been working form many hours but can't find the solution.

 

This is my code.

 

function envia(url, metodo) {

if(!metodo)metodo='GET';

 var peticion_http = createXMLHttpRequest();
  
if(peticion_http) {
try{
    peticion_http.onreadystatechange = function() {
       recibeAjax(peticion_http);
    };
   
    peticion_http.open(metodo,url,true);
    peticion_http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
    peticion_http.send(null);
  }catch(err){
        alert(err);   //this try catch don't work. Never execute this alert.
   }
}
}

 

function createXMLHttpRequest() {
   var peticion_http1 = null;
   try {
         peticion_http1 = new XMLHttpRequest();
   
        if (typeof peticion_http1.overrideMimeType != "undefined") {
              peticion_http1.overrideMimeType("text/xml");
         }
     } catch (ex) {
                peticion_http1 = null;
     }
     return peticion_http1;
}

 

I don't know what's happen.

 

Thanks for your help.

 

New Developer
Posts: 23
Registered: ‎03-12-2011
My Device: Bold 9700
My Carrier: Tigo

Re: Ajax Problem in BB Torch

Hey, whats happen?

 

Anyone would help me?

 

 

New Developer
Posts: 23
Registered: ‎03-12-2011
My Device: Bold 9700
My Carrier: Tigo

Re: Ajax Problem in BB Torch

?????????????

??????????????

Retired
Posts: 3,708
Registered: ‎10-16-2008
My Device: Z10
My Carrier: Rogers

Re: Ajax Problem in BB Torch

What verb is causing the problem on the AJAX request... GET,POST,PUT,DELETE etc...

Tim Neil
Director, Application Platform & Tools Product Management
Follow me on Twitter
New Developer
Posts: 23
Registered: ‎03-12-2011
My Device: Bold 9700
My Carrier: Tigo

Re: Ajax Problem in BB Torch

I'm using GET Request in my widgets.

 

I note that the error is in Blackberry OS 6.0. I have problems with other devices with same O.S.

 

I don't know if this problem is a 6.0 bug.

 

I'm using a simple code.

 

Thanks for your help.