Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Event handling
Message
Information générale
Forum:
Javascript
Catégorie:
JQuery
Titre:
Divers
Thread ID:
01586772
Message ID:
01586776
Vues:
31
>>>I want to be sure that I understand one basic concept of event handing by Javascript or jQuery correctly.
>>>
>>>A very simple example:
>>>
>>>Page has a few buttons and a few input elements. One of the buttons ID is ‘btnTest’
>>>
>>>Here is the script in the Head section of the page:
>>>
>>><script type=”text/javascript” >
>>>    $(document).ready(function () {
>>>          FireClickMethod();
>>>    });
>>>   Function FireClickMethod() {
>>>       $(‘#btnTest’).click( function () {
>>>           Alert(‘ Button clicked’ )
>>>        })
>>>    }
>>></script>
>>>
>>>
>>>Does method FireClickMethod fire when user clicks on any of the buttons? Of course I understand that jQuery will look for element ‘btnTest’ and will determine if the click was on this button. But I just wanted to understand that method files FireClickMethod() on every click or other event on the page. Do I understand this correctly?
>>
>>
>>http://api.jquery.com/ready/
>
>Thank you. But it still does not answer my question (of course if I understood jQuery well I wouldn't ask the question <g>). From the link you kindly provided and reading the description I see that the Ready() is executed when the page is fully loaded. And the method FireClickMethod (of my example) is wired when the page is "ready". But later when user clicks on a button different than the 'btnTest' does method FireClickMethod fires?

No, it would run just ALERT().
Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform