Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Ananta_Teor_A_1
Beginner
75 Views

Ajax request fail on App Preview

Jump to solution

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>

Tags (2)
0 Kudos
1 Solution
Boris_B_1
Novice
75 Views
2 Replies
Pamela_H_Intel
Moderator
75 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

Boris_B_1
Novice
76 Views
Reply