Jquery has been used for nearly a year. Today, I am reading the code of a foreign company and suddenly find that I don't understand it. The Code is as follows:
$ (Window). bind ('Load. jcarousel ', function () {windowLoaded = true ;});
Maybe I don't know much about jQuery. I have read a beginner book about jQuery, and I am always learning at work. When I encounter problems, I will sum up a little and learn a little... hey, maybe why is it that the company has more than one year of work experience or something, and the actual practice is the most rapid improvement.
Find the jQuery API and explain it as follows:
1. You can bind multiple events at a time. For example:
Copy codeThe Code is as follows:
$ ('# Foo'). bind ({
Click: function (){
// Do something on click
},
Mouseenter: function (){
// Do something on mouseenter
}
});
2. Any string used as the type parameter is legal. If a string is not a native JavaScript event name, the event handler will be bound to a custom event. These custom events will never be triggered by the browser, but can be manually triggered by using. trigger () or. triggerHandler () in other code.
3. If the string of the type parameter contains a dot (.) character, this event is considered to have a namespace. This dot character is used to separate the event and its namespace. For example:
$ Obj. bind ('click. name', handler), the click in the string is the event type, and the string name is The namespace.
All right, that's it. I'm going home from work. This month I will summarize a jQuery development model. Be prepared. Finally, I hope this article will help you.