9
var tinymce_toolbar = {} tinymce_toolbar.__default = { script_url: '/cms/libs/js/manual/renders/tiny_mce/tiny_mce.js', }; tinymce_toolbar.__simple = { script_url: '/cms/libs/js/manual/renders/tiny_mce/tiny_mce_simple.js', }; // Doesn't work var t = $(this).find('input[name=toolbar]').first().val(); $('.RenderHtmlEditor').tinymce(tinymce_toolbar.t); // works var t = $(document).find('input[name=toolbar]').first().val(); $('.RenderHtmlEditor').tinymce(tinymce_toolbar.__default); $('.RenderHtmlEditor').tinymce(tinymce_toolbar.__simple); 

how i do it to be dynamic? Thanks

0

2 Answers 2

9

object['name'] is quite same way as object.name. simply assign a associative attribute and use it as a property.

Sign up to request clarification or add additional context in comments.

Comments

5

Instead of dot notation,

tinymce_toolbar.t 

Use subscript notation:

tinymce_toolbar[t] 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.