AJAX request returns status '0 '.

I am building a page that makes a standard XMLHttpRequest to a php script. On all other browsers, I get a status code "200", but on the BlackBerry I get "0" for the State. Has anyone experience this problem? Here's the code I'm working with:

                            var httpRequest;

                            if (window.XMLHttpRequest) { // Mozilla, Safari, ...
                                httpRequest = new XMLHttpRequest();
                            } else if (window.ActiveXObject) { // IE
                                try {
                                    httpRequest = new ActiveXObject("Msxml2.XMLHTTP");
                                }
                                catch (e) {
                                    try {
                                        httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
                                    }
                                    catch (e) {}
                                }
                            }

                            if (!httpRequest)
                                return false;

                            httpRequest.onreadystatechange = stateChange;
                            httpRequest.open('GET', post);
                            httpRequest.send();

                            function stateChange()
                            {
                                alert(httpRequest.readyState + " | " + httpRequest.status + " | " + httpRequest.statusText + " | " + httpRequest.responseText);
                            }

I found a solution. The problem is that the PHP proxy called a different field and the detected blackberry device I guess. What I did change my method to use CURL for just using the php file and everything is fine now.

Tags: BlackBerry Developers

Similar Questions

  • Problem using the structure returned by the ajax request

    I'll send an ajax request that calls a method in a CFC.  The method executes a query and returns data.  I want to use the option of 'success' of the ajax call to display the return value "myString" in an empty div.  But nothing appears.  Everything else works.  Shouldn't the ajax call back for me "myString" and values "myNumber" which I can then use?  Or do I have the wrong syntax?

    <script src="//code.jquery.com/jquery-1.10.2.js"></script>
        <script>
      function getMyData()  
      { 
      $.ajax({
      type: "post",
      url: "test.cfc",
      dataType: "json",
      data: {
      method: "getMyData",
      city: 'Hartford'
      }
      , success: function(data) {$('#result').html(myString);}
      , error: function(data) {$('#result').html('That failed');}
      });
      $('#anotherDiv').html('Goodbye');
      }
      </script>
    </head>
    <body>
    
    <a href="javascript:()" onclick="getMyData();">
       <div>Click here</div>
    </a> 
    
    <div id="result"></div>
    <div id="anotherDiv"></div>
    

    <cfcomponent>
      <cffunction name="getMyData" access="remote" returntype="struct" returnformat="json">
        <cfset var stcRetVal = StructNew()>
            <cfset stcRetVal.myString = "Hello">
            <cfset stcRetVal.myNumber = 75>
        
            <cfquery datasource="#application.mainDS#">
      insert into test 
                (city) 
                values 
                (<cfqueryparam value="#arguments.city#" cfsqltype="cf_sql_varchar">)
      </cfquery>
    
    
      <cfreturn stcRetVal>
      </cffunction>
    </cfcomponent>
    

    If your function should return you structure JSON like:

    {

    'myString': 'Hello,'

    "myNumber": 75

    }

    When you succeed, you do:

    success: {function (data)}

    $('#result').html (myString);

    }

    whence "myString"?  All that gets you back is in this object 'data '.  So, you might be able to do it instead.  Try to console.log (data) inside your success Manager.

    success: {function (data)}

    $('#result').html (.myString data);

    }

  • Cisco TMS 14.4 "Ajax request failed...". »

    Hi Experts,

    I installed Cisco TMS 14.4, installing all makes them very well, but at the first connection, I had error in Pop - Up The Ajax request failed...

    TMS ERRORCOOKIE {FF44A030-7F95-461C-8065-615FCE335F7B} var TMSError = {toggle: function (tableId) {var errorTable = $(tableId); errorTable.style.display = 'block';}} TMSElement.positionCenter (tableId); $('InfoTable').style.display = 'none '; }} Stop_Wait();   An error has occurred!
    Please click the back button on your browser to return to the previous page or click here to go to the front page of TMS. If the problem persists, contact your administrator to TMS.

    You can see the image

    Can someone help me

    Thank you

    Hello

    It should be a more specific error message in the log - web.txt, located in the \data folder in the MSDS on your server installation directory. What did he say?

    Kind regards
    Kjetil

  • AJAX request for example help

    Hi all
    I have a question regarding the excellent example Denes Kubicek has Section III - Ajax request for example - http://apex.oracle.com/pls/otn/f?p=31517:135:1771969688591802:NO. This example contains text, elements of field based on the data entered when the user clicks on the search button. I've implemented this example successfully, but one of my items in my test application is a Select list (real application will select a few items in the list). Can someone help me in completing my item in the list to select the exact data when search is selected? No data is returned. When my search for end users, I still want they to be able to apply the changes which is why I want the select list active for some items, thanks before all time.

    Hi Charles,

    {The question was that there were a few}'s to spare in the code. I commented on these stars and all seems ok now - the selection list is being updated as you selection/next/previous

    I have not, yet, have a unique demo application - I actually have 98 different ones in my workspace containing 1 156 pages. I keep meaning to all this merge in one great app and let everyone connect users. But I don't have time now to do for this number of pages! Most pages, are good in my applications 267 and 33642, so if you do a search for these numbers and my username (503936), then you will see most of the things I've done.

    Andy

  • Firefox an abortion any AJAX request when you press ESC

    Why firefox an abortion any AJAX request when you press the ESC key?

    I don't see any value in a feature like that. As a matter of fact, no other browser to do this.

    This has happened

    Each time Firefox opened

    Hello Fabio.

    First of all, and although that perhaps not related to your problem, I would remind you that the version of Firefox you use right now since been abandoned and are no longer supported. In addition, it has known bugs and security problems. I invite you to upgrade to the latest version of Firefox, for maximum stability, performance, security and ease of use. You can get it for free, as always, to www.getfirefox.com.

    As for your question, if you are absolutely sure that this problem is not an add-on you have installed and has not been changed in the latest versions, you should file a bug at bugzilla.mozilla.org to request this behavior to change.

  • AJAX request works just with a Wi - fi Blackberry Widget

    I'm doing an Ajax request to're RESTful WebService. When I run the Simulator everything works fine, but when I install the widget for blackberry on my device (9800) applications works when I'm using the Wifi connection...

    It's my config.xml file:

    
    http://www.w3.org/ns/widgets" xmlns:rim="http://www.blackberry.com/ns/widgets" version="0.2.0.0">
      bbbb
      bbbb
      
      
      
      
      
      
      
      
      
      
        
        
        
        
        
        
        
        
        
      
      
      
      
        TCP_WIFI
        MDS
        BIS-B
        TCP_CELLULAR
        WAP2
        WAP
      
      
      
    
    

    Why this is happening?

    Finally! I found it! I have no why, but it works only on .com, .net o .org domains

    I made the request to a .mobi domain.

  • affecting values to display only point during the AJAX request

    Hello

    Hello!

    In a master form / detailed in the report in detail, I'm filling two columns SERVICE_TAX_PCT and SERVICE_TAX_AMOUNT by an AJAX request after selection of the ACCOUNT_CODE.  The values are filled out with any problem.

    However, whenever I do these two fields in view-only mode, the values are not get defined.  Is there a way to set the values of a field at the same time, it should be limited to the user to modify?

    (APEX 4.2.6)

    img-1.png

    Thank you

    -Anand

    Hi Anand,

    anand_gp wrote:

    It works and makes the column read-only.  But in this case only for the line of action.  How do these two columns 'read only' permanent for all folders and all the time?

    (1) not remove the code from line 18 of your javascript that is function

       $("#f05_" + row_id).attr("readonly", true).addClass('row_item_disabled');
    

    (2) then create after updating dynamic action and put this code

    Event: after refresh

    Selection point: region

    Region: you select the region

    Action: Run Javascript

    Fire on charge: checked

    Code:

    $('input[name="f05"]').attr("readonly", true).addClass('row_item_disabled');
    $('input[name="f06"]').attr("readonly", true).addClass('row_item_disabled');
    

    Here replace f05, f06 with your markup of column

    Hope this helps you,

    Kind regards

    Jitendra

  • Is possible to use = href and onclick = Ajax.request to track outgoing link?

    Hello

    I m new in Oracle Apex and I try now to follow outgoing links on my Apex 3.2.1 application.

    When the user clicks on a link of my application that redirects to a past site, I want them to be taken on the site (href) and I also want a background script that fit into a table in oracle, this 'click '.

    For example, I have this link in a page of the APEX:

    When the user cliks in this link, I would like to run a procedure oracle, with a setting in the background. Let´s call this procedure, for example:

    SP_REGISTRA_ACESS_LINK(:P19_COD_TOPICO).

    This procedure to insert a record into a table called BAC_ACESS, ranger in the SYSDATE and value of ': P19_COD_TOPICO.

    Is it possible to link to a new site and call an AJAX request at the same time?

    Could someone give me an example of how I can do? How can I implement in my Apex 3.2.1 application?

    I m working with Apex 3.2.1 and RDBMS 9i. I can't spend any of these versions, cause Apex is installed in a production database that can be upgraded now to 10g / 11g.

    Best regards

    Sergio Coutinho

    Hello

    Ok
    One solution could be to make you your own custom County click procedure that you call in the URL.
    You go to this external link to procedure and other settings you need.
    Procedure to make your custom orders and last stage call owa_util.redirect_url and redirect the user to this external link
    http://download.Oracle.com/docs/CD/B13789_01/AppDev.101/b10802/w_util.htm#997457

    You create the APA procedure, analysis of schema and grant execute user to DAD.
    In addition, you may need change Apex schema function wwv_flow_epg_include_mod_local
    http://download.Oracle.com/docs/CD/E17556_01/doc/admin.40/e15521/adm_mg_service_set.htm#AEADM209

    Kind regards
    Jari

  • Execution of a declarative elements AJAX requests

    HI guys,.

    We are building an ADF based portal application and design involves the creation of a declarative component which will be 'built' in the jspx parent page. This declarative component, during rendering, you must call an AJAX JavaScript application, based on the attributes that have been passed into the constructor of declarative components highlighted below. Essentially, we need to take the value of the ss_Email field and use it in a custom js function (defined in the declarative component) to call an AJAX request to an external resource and view the results online in the component. The reason why this component must call the AJAX code is our end point expects a connection token that is generated from the browser. The call of the declarative component is defined as follows:

    < af:form id = "f1" >
    < af:panelGroupLayout id = "pgl1" layout = "vertical" >
    < ss:ssConsumer id = "sc1" ss_Email = "[email protected]" ss_LastName = "Pradhan" / >
    < / af:panelGroupLayout >
    < / af:form >

    What I did in my component declarative is to set the value of the attributes of elements in a field of entry as follows:

    < af:inputText label = "email" id = "inputEmail" value = "#{ss_Email}. uploading" columns = "40" clientComponent = "true" >

    It works and I can see the correct value passed into the component. I have a problem with is hang what component text input, such that I can call a method of Javascript that I can read my af:inputText value in a method and begin my AJAX call. I tried to attach an af:ClientListener but it does not help because there is no interaction of the user within that component, that is why none of the types of events (mouseover, blur, click, etc.) are useful. I need actually an event 'onload' for the declarative component, but of course, this does not exist. To solve this problem, I used a block of standard script to force the component to call my js method that is

    < script language = "javascript" reporter = 'reporter' >
    getTextValue();
    < /script >

    The problem I am facing now, is that I'm not sure that ADF JS API will give me the value of my input text. I tried the methods AdfPage.PAGE and tried to retrieve the correct value, but have so far failed.

    var label = AdfPage.PAGE.findComponent('dc_pgl1:dc_pfl2:inputEmail').getValue();)
    var Label2 = AdfPage.PAGE.findComponentById('dc_pgl1:dc_pfl2:inputEmail').getValue();)
    var Label3 = document.getElementById('dc_pgl1:dc_pfl2:inputEmail').value;

    I guess because it is a declarative component and not in the Page, I can't use these methods. Are there alternatives that should I try or pointers to other ADF JS method calls that I should try to get the value of my javascript input text.

    Many thanks in advance,

    Sanjay

    Hello

    as far as I know, all Trinidada component trh:script did the same thing as

  • ADF 11 g - how to tell the difference between an entire page and an AJAX request

    Hello

    I noticed that a ControllerClass (an instance of oracle.adf.controller.v2.lifecycle.PagePhaseListener, which I defined in the ControllerClass of the pageDefinition property) also get a life cycle AJAX request. The question is how did I get the difference between a request for a full page and a PPR/AJAX application from inside the afterPhase() or beforePhase() method?
    Thank you.

    Rgds,
    Rudi

    isPartialRequest going to do: http://www.oracle.com/technology/products/adf/adffaces/11/doc/adf-richclient-api/apidocs/oracle/adf/view/rich/context/AdfFacesContext.html#isPartialRequest (javax.faces.context.FacesContext)

    John

  • AJAX request fail with "no transport.

    Hello

    I have the following call:

    $.ajax
    ({
        type: "POST",
        crossDomain: true,
        url: "http://domain.net:2000/login_check.php",
        dataType: "text",
        data: {user: username, pass: password},
        success: function(data)
        {
            if (data.trim() == "S")
            {
                window.location="profile.html";
            }
            else
            {
                window.location="index.html";
            }
        },
        error:function (xhr, ajaxOptions, thrownError)
        {
            alert(xhr.status);
            alert(thrownError);
        }
    });
    

    It works in a normal browser, and even in the emulator of ripple (isn't that the emulator ripple supposed to imitate and not just be a wrapper of chrome?), but on the device, the call fails. thrownError returns "no transport.

    Did I miss something in my file config.xml?

    
    
    
    
    http://www.w3.org/ns/widgets"
            xmlns:rim="http://www.blackberry.com/ns/widgets"
        version="1.0.0.0">
    
      Launch Lawyer
    
      
          Launch Lawyer
      
    
      http://opensource.org/licenses/alphabetical">
      
    
      
      
      
      
      
      
      
      
      
      
      
      
      
    
      
      
      
    
      
      
    
      
      
    
      
        
      
    
      
    
    
    

    in your config.xml file, try to add this element:

    
    TCP_WIFI
    BIS-B
    TCP_CELLULAR
    MDS
    WAP2
    WAP
    
    

    or configure this depends on you internet connection transport you use in the camera.

  • XML Http Request returns only "undefined"?

    Hi all

    XML Http Request only returns "undefined".

    Any idea what's going on?

    Have you in the white list the areas that you try to access the config.xml file?

    https://developer.BlackBerry.com/HTML5/documentation/access_element_834677_11.html

    Otherwise, see this example page that shows how to use XHR. Maybe there is an excerpt that is missing in your code?

    http://BlackBerry.github.IO/WebWorks-samples/kitchenSink/HTML/browser/XHR.html

  • DBMS_CUBE. BUILD the return status

    Hello

    using 11 GR 2, nobody knows how one can determine the State of a DBMS_CUBE return. Build() appeal, i.e., was the successful update and committed or unsuccessful and rolled back? (Note that I use the atomic_refresh option).

    Thank you
    Chris

    If there is no error message, then the build succeeded. You can also look at the STATUS column of the CUBE_BUILD_LOG table, if you have created.

  • How can I get the return status of the page load indicator?

    After updating to Firefox 29.0.1, the little spinner loading status page has disappeared.
    There is more to the display/bar Tools/Customize screen, so I can't put it in the menu bar
    I was doing.

    Is there an add-on for this?

    Thank you, that was helpful...

  • HP OfficeJet 8600 not return status and ink levels

    Hello

    I have a new one (from this summer) a model HP OfficeJet 8600 (N911a) AIO

    Just run out of black ink on startup of the cartridges provided all.  At purchesed an Office Jet Valuepack 951XL and 950XL in preparation.

    So I replace the Starter 950 black void for the black of 950xl, all ok thing prints, scans/copies fine

    But when I launched the web interface to check the status of the printer status and ink levels are in red and I can't get the ink gas monitor section.  Screen attached.

    If I try to launch the HP printer Assistant for model nothing happening!

    Any suggestions please?

    RGS

    Steve

    Hi all

    OK I solved this problem. But since then, I had cause to rebuild my main desktop PC is so BRAND new HP software has been installed and the question has not reappeared.

    Thanks for everyone for entry

    Steve

Maybe you are looking for