I am working on a custom piece where I am dynamically building very specific tables and writing them out using javascript after an AJAX call. I am trying to avoid writing custom code for each of these tables by coming up with a standard layout where I customize the layout via values in a JSON object stored in my current javascript file. Is there anyway I can store this object in another file and read it as if it were a properties file to make things neater?
Share
Javascript stored in separate files can be referenced as long as it is not wrapped somehow in a function, if so then you would need to reference that function. Thus JSON objects stored in separate files can be referenced – they are just Javascript (everything is an object in Javascript).
SO if you have simple object, or complex JSON:
They can still be referenced, if they are in the same file, or not.
shows “fredwilma”
Of course JSON objects would be more complicated, but the principle still applies.