Ajax Questions

Discussion and feedback on Construct 2

Post » Tue Oct 25, 2011 7:57 pm

I am looking through the Ajax plugin, and I have random general questions in regards to it, and possibly, a additional options for it.

- why is it using the 'GET' method only?
- what if I want to pass variables and values (I assume this has to be set in the URL string?)
- is it only limited to the same domain? And/Or is mobile a bit more loose on this?
- JSON? Can I get my data back in JSON format please?

Thanks
B
4
G
1
Posts: 18
Reputation: 609

Post » Tue Oct 25, 2011 8:07 pm

You can check this tutorial about AJAX and this related topic.

The limitation to the domain comes from a security limitation from javascript itself.
Anyway, mobile or desktop, as long as you're hosting your application on some domain and making AJAX's request to this domain, it should work.

To get back datas in JSON, you have to set your server-side script to return in JSON.

For the 'GET' question, I agree I'd like 'POST' requests too. They might be added in a future release.

Be sure to check the How do I FAQ to check more topics about AJAX and other subjects.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,999
Reputation: 57,793


Return to Construct 2 General

Who is online

Users browsing this forum: Google [Bot] and 17 guests