JQuery Flashcards
Where should you go to get jquery?
Go to google’s hosted JQuery Library
Where should you go to get jquery?
Go to google’s hosted JQuery Library
What is the script that you MUST include to run JQUERY?
What tag must you have for ALL jquery to fall under in order to run?
$(document).ready(function(){
}
What is the script that you MUST include to run JQUERY?
What tag must you have for ALL jquery to fall under in order to run?
$(document).ready(function(){
}
Say I wanted to add an event handler on click for a button?
under the document ready function:
$(‘button’).click(function(){
alert(“You have clicked a button!”);
});
What is documentation?
Library of eventlisteners in Jquery
What is the basic flow of JQuery?
1) Select the element, class or id using the JQuery selector.
2) Add an event listener: How do you want this event to be triggered?’
3 Write the code on what you want to happen when the even is triggered?
Documentation is API documentation and contains what?
How to use documentation and….library of all event listeners in JQuery
What are getters and setters?
A getter gets the value of something…it spits out a value.
example of a getter: var myText = $('#myParagraph').text(); alert(myText); //.text() GETS the values from myparagraph and a variable holds this information in this example
example of a setter:
$(‘#myParagraph’).text(‘see how I work as a setter’);
This?
In what context am I doing this? It’s only doing on THIS.
What do you need to understand in jQuery if you want to use APIs and AJAX
Dynamic content. It is HTML code that you generate after the page loads.
You must master traversing through HTML elements, which is how we reference HTML elements relative to their containing, or neighboring elements.
Why are .html() and .append() so important?
Ability to add new HTML content for any page you make. This is called dynamic content. The rules for adding jQuery listeners onto your dynamic content are a little tricky because at first, your browser doesn’t’;t know that the content is even there.
What is the most effective way to add event handlers to dynamically rendered HTML content?
Use the .on() method.