Software Archive
Read-only legacy content
17061 Discussions

Ajax request fail on App Preview

Ananta_Teor_A_1
Beginner
423 Views

Hello I got this problem where the ajax request I'm trying to pull didnt work in App Preview running on Android.

<html>
<head>
    <title>AJAX and XDK</title>
    <meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=0;" />
    <script type="text/javascript" charset="utf-8" src="http://code.jquery.com/jquery-2.0.3.min.js"></script>  
    <script src="intelxdk.js"></script>
    <script src="xhr.js"></script>
    <script>
        function doAJAX() {
            $.ajax({
                type:'GET',
                url:'http://mydomain.com/mydata.php/',
                success: function (data) {
                    alert(JSON.stringify(data))
                }
            });
        }
</script>
<style>
    body {font-family:arial;background-color:white}
</style>    
</head>
<body>         
    <h3>AJAX Call</h3>
    <button onclick="doAJAX()">AJAX Call</button>
    <button onclick="navigator.app.exitApp();">CLOSE APP</button>
</body>
</html>

0 Kudos
1 Solution
2 Replies
Pamela_H_Intel
Moderator
423 Views

Arianta,

Does it actually fail to return data? We had an issue with JQuery1 where data was returned but an error message was also returned.

Pamela

0 Kudos
Boris_B_1
Novice
424 Views
0 Kudos
Reply