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


Thank you for visiting the BlackBerry Support Community Forums.

BlackBerry will be closing the BlackBerry Support Community Forums Device Forums on April 1st (Developers, see below)

BlackBerry remains committed to providing excellent customer support to our customers. We are delighted to direct you to the CrackBerry Forums, a well-established and thorough support channel, for continued BlackBerry support. Please visit http://forums.crackberry.com or http://crackberry.com/ask. You can also continue to visit BlackBerry Support or the BlackBerry Knowledge Base for official support options available for your BlackBerry Smartphone.

"When we launched CrackBerry.com 10 years ago, we set out to make it a fun and useful destination where BlackBerry Smartphone owners could share their excitement and learn to unleash the full potential of their BlackBerry. A decade later, the CrackBerry community is as active and passionate as ever and I know our knowledgeable members and volunteers will be excited to welcome and assist more BlackBerry owners with their questions."

- Kevin Michaluk, Founder, CrackBerry.com

Developers, for more information about the BlackBerry Developer Community please review Join the Conversation on the BlackBerry Developer Community Forums found on Inside BlackBerry.


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.