I do some debugging and I found this statement:
$(this)[widget.widgetName](widget.attributes);
where widget.widgetName = chart
What is the meaning of this statement in jquery?
In the stack I saw that jquery_ui calls _createwidget of jquery-ui
Why does createwidget get called ?
Regards,
Yossi
$(this)[widget.widgetName]uses square bracket notation to refer to the property whose value is the value ofwidget.widgetName. For comparisons between square backet and “dot notation” see the MDC article.As you said
widget.widgetNameischart, it’s refering to:and then the
(widget.attributes);is simply invoking the function and passingwidget.attributesas the first and only parameter:As for “Why does createwidget get called?” The
chart()function must call it, either implicitly (through another function) or explicitly.