We have javascript files that are environment specific, and so I was thinking of going down the path of creating a generic way to read in an XML (config) file to store different environment specific settings. I was curious to know if anybody else on here does that (or if not, is there a reason why you don’t)?
Share
JSON is hundreds of times faster to consume than XML, bring a native JavaScript object itself. Attach and forget.
EDIT:
James Westgate’s example is JSON. You can use this inline or as an external file or even loaded via AJAX.
Here is another example: