Jon
Jon

Reputation: 8531

Pass In Config Values to JS File

I have a JavaScript file, and I would like to pass in a few config values to my JS file. I originally thought of using an .INI file, but I found out that the browser cannot access these System Config values. Does anyone have any suggestions to alternatives?

Upvotes: 0

Views: 1418

Answers (1)

feeela
feeela

Reputation: 29932

I store my configuration in a separate JSON file and load that into the app as a configuration object.

See this answer for examples on how to do this using Require.js or jQuery: requirejs load static JSON file

Upvotes: 2

Related Questions