I want to make a page on domain example1.com and get/parse a JSON file on another domain example2.com/json.json. Can the json file be generated with javascript (on example2.com)? I think this can be done with php, but I want to do it with javascript. If it is not possible to generate a json file with javascript, is it possible to get/parse an object from a javascript file? EX: example1.com to example2.com/js.js
EDIT: Ok, so it is not possible to get/parse an object from a javascript file, because it is client side. So my only option is to generate a JSON file. Is it possible to do that with Javascript? I know it's probably not the best way, but I want to do it in JS, not PHP.