In JQuery, how do I add an onload or init even to an object? -


I have to hide a selection box control display / sections in the form

First of all, A .change event added, and it works if I actually changes the item

  $ ('# myselect'). Change (function () {updateSections ($ (this));});   

Then I wanted everyone to be called .change at least once, when the page is full

the same The way I could think was that $ (document) .ready looks like a different place

  $ (document) .ready (function () {updateSections ( $ ('#mySelect'))}}}}   

The main issue is that I do not have the id of the item from which I type the function (generated code)

That's why I want to do something like this, and it does not know that there is something to do Africa is

  $ ( '# myselect').) {UpdateSections ($ (this))}}. Init (function (updateSections ($ (this))}};   

.load () only a / Img tag

Apart from the perspective of a design, the on-draw of an item is a standard phenomenon in any UI framework, and is an event directly on the object, And the document looks strange to me

jQuery calls to call you just . Change () will be allowed on the load. You can do something like this:

  $ (document) .ready (function () {$ ('# Myselect'). Changes (work () {updateSections ($ (this));}); $ ('# MySelect'). Change ();});   < P> You possibly can insert  .change ()  after the first  $ ('# myselect')  event for the abbreviation, but I wanted to be the verbose;  $ ('# MySelect'). Change ();  defined  .change ()  will fire on selection box.   

Comments

Popular posts from this blog

mysql - BLOB/TEXT column 'value' used in key specification without a key length -

c# - Using Vici cool Storage with monodroid -

python - referencing a variable in another function? -