I’m looking for the ‘best practice’ as to where the JSON should be stored if it’s just a string array. Should it be stored in a variable in a script block in the HTML page? Should it be stored in a JavaScript file outside of the HTML for separation? Or should it be stored in the plugin itself?
If it should be an external js file, what’s the ‘best practice’ naming scheme for the file? I know the accepted jQuery plugin name is jquery.plugin.js or jquery.plugin-min.js (for the minified file).
Depends, if you need the JSON right away you can store it anywhere to get it executed:
If it’s a lot of Data and you don’t need the data right away, you can always make an ajax call to a file named something like ‘data.json’.
For naming the plugin name, well it’s really up to you, but yeah I believe jquery.pluginname.js is the standard way of doing it.