i trying get a json variable from php to foreUI and dosen’t work, i put my jsonvariable online (http://www.gdsautomacao.com.br/jsonte…) if anyone know how i supost to do that, please help.
The problem is that your PHP script implements JSON API instead of JSONP API.
“The difference between JSONP and JSON is that, JSONP will wrap the JSON data as a function call, while the function name is passed in from the request URL. Calling JSONP API is usually used to workaround the “The Same Origin Policy” and get JSON data from different servers. You can find a lot of information about these via Google.”
The sentence above is taken from http://www.foreui.com/blog/?p=1323, you can read it if you want to learn more.
If the PHP script is implemented by you, you can easily change it to JSONP. Just output json value with a callback function, like this:
After doing this, if you visit http://www.gdsautomacao.com.br/jsonte…, you will get:
If you visit http://www.gdsautomacao.com.br/jsonte…, you will get:
Then you can use “Get JSON Object” action to call your PHP script.
Thanks a lot ! its working now, i just have to do what you say and work ! thanks !
This question is now closed