Script Final/DILDO
JSONP
"JSON with padding" is a complement to JSON data that lets you request data from a server in a different domain, which is typically prohibited by web browsers due to their cross-domain security policies.
If you want to use JSONP with an Ajax request you need to use:
$.ajax method
In a simple assignment statement, you use the _____ operator.
= equals equal
Sometimes, validating the HTML code for a web page will help you debug an application, because:
A trivial HTML error can cause other types of errors.
API
Application Programming Interfaces. Show how to use Ajax to get data from their sites. You can get data from these sites to enhance your own web pages.
An online API editor can help you get the names of the data items that are in the feed that's returned form a web site (T/F).
False
The SONP for a website tells you how you can use Ajax to get data from the site (T/F)?
False
getElementById()
Gets the HTML element that has the id that's passed to it and returns that element.
Cross-browser compatibility is a serious development issue because Internet Explorer and the other browsers don't always interpret:
HTML, CSS, JavaScript the same way.
CSS styles
ID (#) Class (.)
Node JS
Node.js is similar to a command prompt and is written in JS. It can be run on multiple operating systems. It is very lightweight and very fast.
Firebug Features
Provides excellent debugging capabilities. In the Console panel you can click the Errors button. That will display an error message. Click on the line of code in the Console panel or click on the line marker to the right of the line of code. That will open the Script panel with the portion of JavaScript code that contains the statement displayed and the statement highlighted.
HTML5 provides new _______ attributes for input elements that indicate the type of data that should be entered.
Type
Roles of CSS
Used to control how web pages are displayed by specifying the fonts, colors, borders, spacing, and layout of the pages.
Class
You code a selector for an element with a class attribute by coding a period followed by the class name. Then the rule set applies to all elements with that class name. This is known as a class selector.
Id
You code an Id Selector for an element with an id attribute by coding a pound sign (#) followed by the id value. This is known as an id selector.
Within a CSS rule set, a rule includes
a property and a value
adding and removing classes
addClass() - add one or more classes to an element and, if necessary, create the class. removeClass() - remove one or more classes.
unshift()
adds one or more elements to the beginning of the array, and returns the new length of the array.
push()
adds one or more elements to the end of the array and returns the new length of the array.
To display a string or numeric data in a dialog box, you use the JavaScript _______ method.
alert
When a client requests a dynamic web page, the HTML is generated by:
an application server
Getting and setting text and input values
attr() - gets/sets the value of the specified attribute. class() - addClass(), removeClass(), toggleClass() val() - gets/sets the value of the first selected control on a form.
JSON
based on a subset of the JavaScript programming language, and it uses conventions that are familiar to programmers of C-style languages. Easy to parse data with JSON. Files are smaller and faster than XML files.
parseInt()
converts the string that's passed to it to an integer data type and returns that value. If it can't convert the string to an integer, it returns NaN.
setInterval()
creates a timer that calls a function each time the specified interval in milliseconds has passed. var counter = 0; var timer = setInterval(function(), 1000);
setTimeout()
creates a timer that calls the specified function once after the specified delay in milliseconds. var timer = setTimeout(function(), 5000);
Now that the HTML5 is used by all modern browsers, the HTML div element should be used primarily for grouping:
elements for JavaScript and jQuery applications.
JQuery
free, open-source, JavaScript library that provides methods that make JavaScript programming easier.
Chaining
functions that are called one after the other.
A CSS selector can refer to a specific HTML element by specifying the value of the elements _______ attribute.
id
Ajax
lets you receive data from a web server without reloading the page. "partial page refresh"
Built-in array functions
push() pop() unshift() shift()
shift()
removes the first element in the array, decrements the array length, and returns the element that it removed.
pop()
removes the last element in the array, decrements the length, and returns the element that it removed.
Substr(start,length)
returns the substring that starts at the specified position, counting from zero, and contains the specified number of characters.
Roles of JavaScript
scripting language that is run by the JavaScript engine of a web browser and controls the operation of the browser.
The easiest way to create a String object is to declare a variable and assign a ______ to it
string
Which of the following methods would you use to remove a class if it's present or add a class if it isn't present?
toggleClass
To remove all spaces before and after an entry in a text box, you can use the jQuery _____ method.
trim
Roles of HTML
used to define the content and structure of a web page.
The basics of arrays
var arrayName = new Array(length); var arrayName = []; An array can store one or more elements. The length of an array is the number of elements in the array.