I would like to be able to access from anywhere in my javascript code a global list of strings defined in javascript.
For example I'd like to define a script like this :
<script type="text/javascript">
function translations()
{
this.mytranslation = "Test translation";
this.mytranslation2 = "Test translation 2";
this.mytranslation3 = "Test translation 3";
}
function messages()
{
this.mymessage = "Test message";
this.message2 = "Test message 2";
}
</script>
The code above doesn't work, it's just here to present the kind of thing I would like.
And I want to be able to call it simply by :
alert(translations.mytranslation);
and
alert(messages.message2);
from all other scripts (as long as the first one have been included of course)
I would like something that works with Internet Explorer 11 (no actual classes support) and above.
Thanks for your advices