Yann, I've handled access origin. I fugured out the problem was with my content type header. Its form instead of Json. I tried using ajax set header to set the content type to app/Jason, but its like its appending it so I get something like content type: xxx-form blabla,application/Json. I posted this on the how do I forum butbim yet to get any help. So my server keeps returning bad request, which implies it knows the data coming is Jason but the header says its form. That is what I need to fix now:the ajax set header action!! Thanks for all the help.
Dasat
Well to debug your problem you have a lot of options:
- you can print the resulting string by inserting the browser plugin and in the action Browser: log(JSON.AsJson(0)) Then you can copy paste the result in http://jsonlint.com/ to see if the json is valid
- you can check if the javascript console gives any error like the famous [quote:r0tn3ua6]XMLHttpRequest cannot load http://scirra.com/. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://www.google.com' is therefore not allowed access.
whose solution is to either host your game on the same server you are querying, or, make the server send the Access-Control-Allow-Origin: * header
- you can check your own server side code to se if everything is ok
And well, if the problem persist, give more detail.
What would you do if a friend was asking for help on an arithmetic problem without showing you the actual problem? <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy"> (considering you have enough arithmetic knowledge, but that's not the point here)