Fixed my CORS problem. It was strange, with the CORS proxy string it worked locally and in the address bar, but when I linked from Facebook it didn’t work. I couldn’t get all three to work at the same time.
And I shouldn’t be using the proxy string anyway. The original plan was just to use it for local development. It didn’t even occur to me that there would be a CORS problem with a website loading its own file. (Still don’t understand that one - CORS drives me crazy.) After some googling and looking on SO, I tried some editing of the
.htaccess file, but that didn’t do it. Finally wrote a php file I can call that will use a callback to read the correct file and return it. That seems to work fine. The code is:
<?php $jsonp_callback = $_GET['jsonp_callback']; $str = file_get_contents('http://www.rachelturgoose.com/img/gallery/gallery.json'); $json = json_decode($str, true); echo $jsonp_callback . '('.json_encode($json).');'; ?>
if anyone is curious. I’m still shaky on php so there may be an extra step in there. But it works fine now.