语言

Menu
Sites
Language
XMLHttpRequest error 102

I'm trying to get content from a public web page using XMLHttpRequest.  The Simulator works fine. But the Emulator and my device both get an error:  ABORT_ERR: XMLHttpRequest Exception 102.  Any ideas of what's happening?  Here's the code:

    var url="http://myurl.com";
    xmlHttp.overrideMimeType("text/html");
    xmlHttp.open("GET", url, false);
    xmlHttp.onreadystatechange = 
        function() {
               try 
               {
	          // Checks responseText isn't empty
            	  if(xmlHttp.readyState === 4 && xmlHttp.status === 200)
            	  {
                    //some code
            	  }
            	}
	        catch (err) {
                        writeLog("ERROR IN onreadystatechange: "+err);
                }            
        };
     xmlHttp.send();

 

查看选择的答案

响应

2 回复
Mark as answer
André Reus

Hi, 
According to Wikipedia 

102 (Processing)

A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request. This code indicates that the server has received and is processing the request, but no response is available yet.This prevents the client from timing out and assuming the request was lost.

So may be the problem is in your server! 

And from your tizen part, make sure all things are okay.... 

You have added privilede, 

<tizen:privilege name="http://tizen.org/privilege/internet"/>

you have allowed domain policy, 

 <access origin="YOUR_SERVER" subdomains="true"></access>
 <access origin="*" subdomains="true"></access>
Alan Buch

André, it was the access, as you pointed out!  Thank you!!