Javascript, DOM, & JQuery Flashcards
What is Javascript?
- Enhance client side of SAAS applications.
- It is embedded in all browsers.
- It can be triggered by user events.
- It can be triggered by Asynchronous server responses.
- It can design and modify the DOM.
- Interpreted and dynamically typed.
- No classes, but has prototypal inheritance. it is Object -Oriented though.
- Each HTML page gets its own JS Global object. So each page must separately load its JS file.
- No instance methods, just properties.
What is JQuery?
It is like Rails for Ruby. A very easy framework for Javascript.
What is AJAX?
Asynchronous Javascript XML.
What Are XmlHttpRequests?
XmlHttpRequests separate content from server and rendering that content, you could make requests to server in the background.
What is the DOM?
There is a DOM which is the Document Object Model. A set of data structures for what the user is seeing. It is language independent. Browser parses HTML or XML to the DOM. The browser provides the functions to javascript.
What is graceful degradation in javascript?
Browsers with JS disabled should be able to use your ap. Javascript problems should not prevent your application from working. Conditionally show page elements with javascript.
Javascript client side code can interact with the HTML page elements because this functionality is ____.
Part of the Javascript language and part of the JSAPI. It is not, however, part of the browser.
What are the Javascript Hashes?
Unlike Ruby, the keys pretty much have to be strings. Value can be pretty much any javascript object. Quotes are always legal. if you use JSON you have to have quotes. If only using javascript, then you don’t need it.
What is var in javascript?
var restricts the variable to the scope of where it is declared. Or if there are no methods, then it is in the global scope.
Functions in javascript?
Also closures = scope of where you first define will be in scope of where it runs.
First class objects in javascript - means you can do anything to it that you could do to like a string.
Variables in functions stay in the functions. Common pattern is to pass functions to other functions.
Functions are actually a type. var make_func = function() { }
What is The Global Object?
Browser provided global object that provide properties to javascript. this in the context without any receiver refers to the global object. Remember this for failures. The Global object represents the document that got loaded and access to JSAPI is through this object.
Can SOFA be applied to Javascript?
Yes. Short Functions, etc. Keep code separate from HTML.
If you manually open two separate browser windows, can javascript code loaded into one of those windows affect the other window?
No, because each window has is own global object and therefore its own copy of the interpreter.
Can the properties of an object be functions?
Yes you can have an object with properties as functions.
R = {}; R.setup = function() {};
Find the False Statement of javascript functions?
a. they can be anonymous
b. they always return a value
c. They can execute concurrently with other functions
d. they can be passed a function as argument
They cannot execute concurrently with other functions. Javascript is single threaded.