You have to get the execution order right.

this is just a declaration, to let javascript know that this function
exists

  MyClass.prototype.init = function (){
                this.imagesHolder = jQuery("#imgs");
        }


jQuery("#imgs") is not executed until you do something like this.


var a = new myclass()

a.init(); // put this inside dom ready


On Dec 29, 8:14 pm, bob <xoxeo...@gmail.com> wrote:
> Yep, I intend to use myClass outside of document ready.
>
> I thought that in order to use jQuery as follows
> this.imagesHolder = jQuery("#imgs");
> inside of MyClass I would have to enclose it inside
> $(document).ready(function(){...
> so that DOM is ready before invoking MyClass.
> Is my assumption wrong?

Reply via email to