jquery - Javascript Namespace called using variable -


i have defined namespace: cookies , under showlabels , showoptions

i want able call namespace on page using jquery val assuming either return showlabels or showoptions ie:

cookies.$.trim($(this).val()) 

how can this?

use square brackets access property string name:

cookies[$.trim($(this).val())] 

Comments

Popular posts from this blog

c# - Send Image in Json : 400 Bad request -

jquery - Fancybox - apply a function to several elements -

An easy way to program an Android keyboard layout app -