global eval jQuery


/ Published in: jQuery
Save to your folder(s)

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


Copy this code and paste it in your HTML
  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


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.