..glad to hear..
> I've managed according to the tutorials to use the local json file through the files folder. Now I would like to try out hosted version of it.I've tried to use the AJAX request http://www.site.com/file.json, but nothing worked...
>
so..let's say.. you upload json file on your site
http://www.StanBond.com/gamefolder/file.json[/code:6tp5f9fw]
and than you use
[img="http://lookpic.com/O/i2/997/i48LnMDP.png"]
in [b]Preview[/b](on localhost) this request will most likely fail & in [url=https://developer.chrome.com/devtools#console]console[/url] you will see something like
[img="http://lookpic.com/O/i2/100/UXShPyYF.png"]
you can bypass this ...with small PHP file(file.php)
[code:6tp5f9fw]<?php
header('Access-Control-Allow-Origin: *');
$myfile = file_get_contents('http://www.StanBond.com/gamefolder/file.json');
echo $myfile;
exit;
?>[/code:6tp5f9fw]
upload this in your [i]gamefolder[/i]
[code:6tp5f9fw]http://www.StanBond.com/gamefolder/file.php[/code:6tp5f9fw]
and now you request
[img="http://lookpic.com/O/i2/298/JDWRFZoK.png"]
I really don't know if this is a good way....but works..
I was also worried about the usability of this approach, and as in the most cases there is a need to read generated by the server json, I've decided to assign the json string onto the variable and echo it.
<?php
header('Access-Control-Allow-Origin: *');
header('Content-Type: application/json');
$string = '{"c2array":true,"size":[3,10,1],"data":[[[0],[0],[0],[0],[0],[0],[0],[0],[0],[0]],[["Nameless"],[1000],[100],[100],[10],[10],[50],[10],[10],[0]],[[0],[0],[0],[0],[0],[0],[0],[0],[0],[0]]]}';
echo ($string);
?>
[/code:6tp5f9fw]