I have this array:
var aLang = new Array(5);
aLang['fr'] = new Array(350);
aLang['en'] = new Array(350);
aLang['es'] = new Array(350);
// [languish] [key] =" item text"
aLang['fr']['Menu1'] = 'Acceuil';
aLang['fr']['Menu2'] = 'Programs';
//---- Key
aLang['fr']['3'] = 'jQuery';
aLang['fr']['OP'] = 'cSharp';
aLang['fr']['OC'] = 'C++';
aLang['fr']['OM'] = 'Lisp';
aLang['fr']['OMT'] = 'Fortran';
//Html tags
<li><a key="Menu1" class="ctext" href="C++.html"></a></li>
<li><a key="Menu2" class="ctext" href="jQuery.html"></a></li>
My fonction to parse and get a value :
function setLocalLang(mrrlanguage, cClass) {
var C = '.' + cClass;
$(C).each(function (i) { // aLangKeys
var strData = $(this).text(aLang[mrrlanguage][$(this).attr('key')]);
var cString = strData[0].innerText;
cString.replace(/\r\n|\r|\n/g, "<br>");
// console.log(cString);
$(this).html(cString);
});
//calling theis function:
setLocalLang('fr', 'cText');
That works fine.
//What i need:
How to parse this array widthout given a literal key. I tryed ($.each), for loop