언어 설정

Menu
Sites
Language
I added the policys in config.xml file but I can not use php file on linux server.

This codes work on local server and linux server but not work on tizen phone.

demo1.html is on my localhost and time.php is on my linux server that has public IP. So when I enter 115.xx.xxx.xxx/time.php on browser's address window it is connected well.

But after I run the project  in the tizen studio the webapp  in Z3 doesn't work. Only the alert run.

I added some policys on config.xml file. https://developer.tizen.org/ko/community/code-snippet/web-code-snippet/how-set-config.xml-accessing-external-server-0

I think the server connection has problem. How can I solve this problem? You can see my tizen web app codes below. Thank you.

index.html

main.js

config.xml

 

ps. I added <a href="115.XX.XXX.XXX">리눅스 서버 열기</a> 

After I click the button. ' This webpage is not available ' alert is shown.

This webpage is not available.

And <a href="http://115.68.229.123/time.php">리눅스 서버 열기</a> is work...

Edited by: 명훈 심 on 14 2월, 2018

Responses

1 댓글
Armaan-Ul- Islam

Your code looks okay to me...

Can't pinpoint exact issue as your server 115.x.x.x is not reachable from my device.  Some Clues I can share:

 

# Use "xyz" instead of 'xyz' (double quotes instead of singles)

xhr.open("GET", "http://115.x.x.x/time.php", true);

 

# May try with async set to 'true'. (Third Parameter of open() )

 

# In your Server side php code remove the comma (,) after *  (Unless it's necessary)

<?php
   header("Access-Control-Allow-Origin: *");
?>

 

# 'Debug As> Tizen Web Application', Then You might debug your app and inspect the issue on Console/Web Inspector.

Inspect the Values of xhr.readyState & xhr.status

 

# While Debugging, In WebInspector go to 'Network' Tab and check the request and responses, That's the best way to pinpoint the problem.

https://developer.tizen.org/development/guides/web-application/w3chtml5supplementary-features/security/cross-origin-resource-sharing#Using_Simple_Requests