Posted By

catchatpas on 07/19/11


Tagged

jquery


Versions (?)

global eval jQuery


 / Published in: jQuery
 

Make you able to use a variable to retrieve an key in a JSON object

  1. 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"}
  2.  
  3. jQuery.globalEval("var messageKind = dico."+typeOfMessage+";");

Report this snippet  

You need to login to post a comment.