I have a set of PHP language files which I use to output text to the user based on the their language choice. I have passed the PHP variables to javascript successfully and they are available as LANG You can see it in use in the code.
Here is my question... Since the code as shown below works perfectly, why can I not change this line...
'No': { 'class' : ''}}
to
LANG.no: { 'class' : ''}}
Basically I want to know why I can use LANG elsewhere in the code but not in the line shown above or in the equivalent "Yes" line.
Here is the working code:
$.confirm({
'title': LANG.return_to_exhibit_lobby,
'message': "<strong>"+LANG.return_to_exhibit_lobby_confirmation+"</strong>",
'buttons': {
'Yes': {
'class': 'special',
'action': function(){
window.location.href='logout.php';
}},
'No': { 'class' : ''}}
});
Lang : { no : { class... } }'banana'. I just can't but a variable name... Only a string. It can be anything... doesn't have to be "No"