Is there a way to create a constant file in JavaScript that I can reference and then use? I am looking for something like this:
Constants.js:
var Phones =
{
Nokia: 1,
Samsung: 2
}
Then, in another JavaScript file, JS2.js refers to these values: JS2.js:
notification (Phones.Nokia);
And then in the aspx file that uses them, refer to both of them, for example:
<asp:ScriptReference Path="../js/JS2.js" />
<asp:ScriptReference Path="../js/Constants.js" />
Is such an architecture possible? What types of data can we use? I just illustrated the enumerations, because this is what I am using right now, but they must be declared in the same file as they are.
The rifle
source share