/ Published in: jQuery

Make you able to use a variable to retrieve an key in a JSON object
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
var dico={"testing":"testing","Please_wait_while_loading":"\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430","Success":"\u0423\u0441\u043f\u0435\u0448\u043d\u043e","success":"\u0423\u0441\u043f\u0435\u0448\u043d\u043e","Error":"\u041e\u0448\u0438\u0431\u043a\u0430","error":"\u041e\u0448\u0438\u0431\u043a\u0430","testing4":"testing"} jQuery.globalEval("var messageKind = dico."+typeOfMessage+";");
Comments
