×

Discussion Board

Results 1 to 3 of 3
  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    16

    Cross site request return status = 0

    I'm developing an app that does ajax requests to a webpage to get html contents. Everything is fine, ajax request returns status 200 (OK) and everything is ok. But sometimes ajax request returns status 0 and I get no contents (I visit with firefox the webpage that I'm doing request to, and it works). There is something to do to solve it?

    I modified firefox preferences (http://mobiledevworld.com/2009/10/19...te-javascripts) to test my widget in my pc, and in my pc seems to work well always. I'm having this issue in my 5800 and others 5800

    Help please

    Sorry for my bad english
    Last edited by pep_dj; 2009-11-26 at 14:12.

  2. #2
    Super Contributor
    Join Date
    May 2008
    Location
    Helsinki, Finland
    Posts
    1,098

    Re: Cross site request return status = 0

    Quote Originally Posted by pep_dj View Post
    I'm developing an app that does ajax requests to a webpage to get html contents. Everything is fine, ajax request returns status 200 (OK) and everything is ok. But sometimes ajax request returns status 0 and I get no contents (I visit with firefox the webpage that I'm doing request to, and it works). There is something to do to solve it?

    I modified firefox preferences (http://mobiledevworld.com/2009/10/19...te-javascripts) to test my widget in my pc, and in my pc seems to work well always. I'm having this issue in my 5800 and others 5800

    Help please

    Sorry for my bad english

    Hi pep_dj,

    Was not quite sure if you still face this problem, but just would like to note something here.

    The status of 200 would mean the URL does exist, whereas if 404 it doesn't, a 403 for access denied, 500...
    What comes to the value 0, for local files that one should check rather than 200. But hardly that is the
    case here. There is also reports on certain libraries having difficulties handling AJAX and sometimes
    may return a 0.

    If in the code we would only check for 200 for "success" and judge any other response as a "fail", then
    that would leave the actual response unknown.

    To get the actual response code visible, here e.g. two ways;
    (jQuery);

    Code:
    complete: function(transport, textstatus){ 
        alert(transport.getResponseHeader("Status"))
    }

    or just plain like this;

    Code:
      if (request.readyState == 4) {
           if (request.status == 200) {
             var response = request.responseText.split("|");
             document.getElementById("order").value = response[0];
             document.getElementById("address").innerHTML =
               response[1].replace(/\n/g, "<br />");
           } else if (request.status == 404) {
             alert ("Requested URL is not found.");
           } else if (request.status == 403) {
             alert("Access denied.");
           } else
             alert("status is " + request.status);
         }

    Maybe you could send the widget to me via the e-mail, I could test it myself. Otherwise, with this amount
    of data is a little bit difficult to me to quickly just plain say why this problem would only happen in a
    5800 MusicXpress.

    Or if you have already found a resolution to this, maybe you could share that?

    Maybe, because you said this problem occurs sometimes, it could belong to the edge cases, meaning the
    small percentage of oddities with using the AJAX - when things fail, that is.

    Best Regards,
    [FONT="Comic Sans MS"][COLOR="Blue"][/COLOR][I]Marko Lumivuori
    Technical Support
    +358 40 8019330
    [email]marko.lumivuori@nokia.com[/email][/I][/FONT]

  3. #3
    Registered User
    Join Date
    Aug 2007
    Posts
    16

    Re: Cross site request return status = 0

    Thanks for reply. I didn't solve it, and I deleted the code. But thanks again.

Similar Threads

  1. Request | SDKs >> Alternative download site
    By series60nubee in forum Symbian Tools & SDKs
    Replies: 21
    Last Post: 2010-01-20, 10:15
  2. How to port Symbian OS String Descriptors
    By birol.sekerci in forum Symbian
    Replies: 17
    Last Post: 2007-11-08, 16:24
  3. 6280 camera capture - no image returned?
    By neomedia in forum Mobile Java Media (Graphics & Sounds)
    Replies: 10
    Last Post: 2006-11-20, 13:29
  4. Can't see my site with Vodaphone 8310 (GPRS)
    By Nokia_Archive in forum WAP Servers
    Replies: 1
    Last Post: 2002-05-17, 14:19

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×