How do I get ajax working on android?

Get help using Construct 2

Post » Tue Dec 09, 2014 1:20 am

I love this engine. I was planning to buy this engine but after some reading regarding AJAX request is not supported in Intel XDK android build, I change my mind. Does anyone get the Ajax request working on Intel XDK works? If you do mind sharing me your option?
B
2
Posts: 1
Reputation: 152

Post » Fri Jan 02, 2015 9:47 am

Hi,

I have same problem not yet found any fixed solution. but - here is a working example of AJAX call in Intel XDK, you can try it in Intel XDK and on device, replace the URL with yours and try

<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://time.jsontest.com/',
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>
</body>
</html>
B
3
S
1
Posts: 6
Reputation: 337

Post » Fri Sep 16, 2016 2:50 pm

Message: gururich can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Try removing the protocol in the url you are sending the request to.

Change:

http://time.jsontest.com/

To:

//time.jsontest.com/
B
2
Posts: 1
Reputation: 152


Return to How do I....?

Who is online

Users browsing this forum: Seruza and 6 guests