언어 설정

Menu
Sites
Language
Wearable 2.3.2 JS XmlHttpRequest: same URL works in Web App but not in Web Widget (status 500)

Hi,

I have a Google URL that I access via JavaScript's XmlHttpRequest object returning JSON that works fine in a Wearable 2.3.2 Application.

If I use the exact same code and URL in a Tizen 2.3.2 Web Widget on my Gear S3, I get a 500 error.

The problem happens in the Emulator and on the watch.

URL: http://www.google.com/finance/info?q=googl

It always works in the App and always fails in the Widget.

I am able to go to other URLs in the Widget without errors!

I did not see any valuable information as to why I am getting a 500 error.

As I said it should be easily reproduceable in the Emulator using Tizen Studio 1.1.

 

Is there anyone who could help me with that or knows a good way to get in touch with Tizen support so that they can help me debug this.

 

Thanks,

Oliver

 

 

 

 

 

Responses

5 댓글
Iqbal Hossain

hi~ 
Did you add the required privileges and access domain policy correctly?

<access origin="*" subdomains="true"></access>   
<tizen:privilege name="http://tizen.org/privilege/internet"/>

If not, add these and try again. 

Oliver Allgaier

Thanks, yes I have. If I would not have, I would have not gotten to the 500 error since this comes from the google server.

I think without that it would not let me out at all.

I do have the Widget and the Webapp in the same project. App works fine. Other urls in the widget work fine also.

Is this a Tizen bug in the XHR object?

Iqbal Hossain

Share your code. I tried to send XMLHTTPRequest from Web Widget, but i couldn't. 

Oliver Allgaier

main.js in the Widget:

window.onload = function() {
    
	window.setTimeout(test,200);
};
	
function test() {
  
  var xhr = new XMLHttpRequest();
  var url = 'http://www.google.com/finance/info?q=GOOGL';  
               
  xhr.open("get", encodeURI(url), true);
  //xhr.setRequestHeader("User-Agent","Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"); 
  xhr.setRequestHeader("Accept", "text/json");
  
  xhr.onreadystatechange = function() {
      if (xhr.readyState === 4 && xhr.status === 200) {
    	  document.getElementById("content-text").textContent=xhr.responseText;
      }
      else {
    	  document.getElementById("content-text").textContent=xhr.readyState +":"+ xhr.status+":"+xhr.responseText;
    	  //document.getElementById("content-text").innerHTML=xhr.responseText;
      }
  };
  
  xhr.send();
  
};


   
  Same config.xml privilege as you posted above.

As for the index.html: just have a full screen DIV with id "content-text".

If you use the exact same code in a Web App, it works fine!

 

 

 

Oliver Allgaier

I tried creating a ticket in JIRA but I get: "Error creating issue: Indexing completed with 3 errors"

So that doesnt work either :(

It there any way to chat with a Tizen DEV or get someone from Samsung's Tizen team looking into this? Are they reading our posts here?

If they want their platform to succeed they need to provide better supports for DEVs.