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
Post a Comment