I want to create an array which can be extended at any time by any of my functions and also can be called (all functions in that array shall be called on array call). How to do such thing with javascript and jquery?
Why I need such thing:
I created 1 big and 25 small JS files each of the small files can be or not included into document. Each small file generates some html when it wants to. But when it generates new html I often need some kind of UI refreshment – some divs to be resized or at least size checked etc. So I need an array of functions for all small JS scripts to put into it all UI refreshment they need, on the onter hend each small JS file will call that array when it creates some more HTML code. (If there was somjething like $(document).htmlDataChange in jQuery I would not need such thing at all.)
I would create an object that has a property to hold the functions, and add, remove, and run methods.