arrays - javascript key i18n -


i have code this.

var myi18n; // json : "{"close":"بستن","locationinformation":"مشخصات جغرافیایی","yes":"بله","no":"خیر"}" 

and want use in somthing this.

$.modal({     buttons: {         myi18n.close: function(win) {          }     } }); 

but have syntax error. method string not change.

var aaa = myi18n.close; $.modal({     buttons: {         aaa: function(win) {          }     } }); 

the way assign properties dynamic names object use array syntax

 var mybuttons = {};  mybuttons[myi18n.close] = ... 

Comments

Popular posts from this blog

jquery - Invalid Assignment Left-Hand Side -

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -