MS 70-480

Some quick study helpers for the MS 70-480 exam (HTML5, CSS and JavaScript) NOTE: This is a study helper containing only those topics relevant to the exam that I wanted to study further. It is by no means complete and was created before the exam.

Some quick study helpers for the MS 70-480 exam (HTML5, CSS and JavaScript) NOTE: This is a study helper containing only those topics relevant to the exam that I wanted to study further. It is by no means complete and was created before the exam.

Mike Voss

Mike Voss

Fichier Détails

Cartes-fiches 70
Langue English
Catégorie Informatique
Niveau Autres
Crée / Actualisé 12.06.2013 / 23.01.2019
Lien de web
https://card2brain.ch/box/ms_70480
Intégrer
<iframe src="https://card2brain.ch/box/ms_70480/embed" width="780" height="150" scrolling="no" frameborder="0"></iframe>

What is the Javascript operator for

is equal to

==

What is the Javascript operator for

is exactly equal to (value and type)

===

What is the Javascript operator for

is not equal

!=

What is the Javascript operator for

is not equal (neither value nor type)

!==

How does the conditional operator work in Javascript?

JavaScript also contains a conditional operator that assigns a value to a variable based on some condition.

variablename=(condition)?value1:value2   Example: voteable=(age<18)?"Too young":"Old enough";

What is the "this" keyword used for in Javascript?

In JavaScript the this keyword always refers to the “owner” of a function. In the case of event handlers it is very useful if this refers to the HTML element the event is handled by, so that you have easy access to it.

How do you create a custom Error (i.e. JavaScript equivalent of an Exception)?

var err = new Error ();
err.message = "My first error message";  
if (err.fileName === undefined)  {
    err.fileName = document.location.href;
}
throw err;

How do you use prototype in Javascript?

Prototype allows for the implementation of something like inheritance in class based languages.

Syntax:

function Ninja(){} 

Ninja.prototype.swingSword = function() {
    return true;
};

var ninjaA = Ninja();

What is jQuery serialize used for?

The serialize() method creates a URL encoded text string by serializing form values.   You can select one or more form elements (like input and/or text area), or the form element itself.   The serialized values can be used in the URL query string when making an AJAX request.

How is the jQuery serialize function used?

$(selector).serialize()  

Example:

$("button").click(function(){

$("div").text($("form").serialize());

});

How do you serialize objects or arrays in Javascript?

Use the JSON methods

JSON.stringify

and

JSON.parse

How does jQuery.getJSON work?

Get JSON is short hand for an AJAX call that retrieves a JSON object from the server asynchronously.

Example:

$.getJSON('ajax/test.json', function(data) {
    // some code
}

What is 

The jqXHR Object and how is it used?

All of jQuery's Ajax methods return a superset of the XMLHTTPRequest object.

This jQuery XHR object, or "jqXHR," is for insstance returned by $.getJSON()  

var jqxhr = $.getJSON( "example.json", function() {
   console.log( "success" );
  })
  .done(function() { console.log( "second success" );})
  .fail(function() { console.log( "error" ); })
  .always(function() { console.log( "complete" ); });

What is a JavaScript Promise?

A Promise is an object that represents a one-time event, typically the outcome of an async task like an AJAX call. 

What are the possible states of a Javascript promise?

At first, a Promise is in a pending state. Eventually, it’s either resolved (meaning the task is done) or rejected (if the task failed).  Once a Promise is resolved or rejected, it’ll remain in that state forever, and its callbacks will never fire again.

How can you combine JavaScript Promises?

You can combine Promises logically into new Promises. That makes it trivially easy to write code that says, “When all of these things have happened, do this other thing.”

composedPromise = $.when(anAsyncFunction(), anotherAsyncFunction());

How does "then" work in terms of Javascript Promises?

The Deferred object exposes a then method which allows the developer to handle both the fulfillment and error states.   

Example:

$.ajax({

url: 'http://search.twitter.com/search.json',

dataType: 'jsonp',

data: { q: '#IE10', rpp: 100 }

})

.then( function (data) { /* handle data */ }, function (error) { /* handle error */ });

Wie funktionieren CSS Transitions?

transition:  [ <transition-property> ||               <transition-duration> ||               <transition-timing-function> ||               <transition-delay> ]

Example:

transition: width 2s, height 2s, transform 2s;

What are the possible timing-functions for a CSS Transition?

  • linear
  • ease
  • ease-in
  • ease-out
  • ease-in-out
  • cubic-bezier(n,n,n,n)

What does the timing fuction cubic-bezir in CSS Transitions do?

cubic-bezier(n,n,n,n) - Define your own values in the cubic-bezier function. Possible values are numeric values from 0 to 1

How do you define a text shadow in CSS?

text-shadow: h-shadow v-shadow blur color;

What 2D transform methods are available in CSS3?

  • translate()
  • rotate()
  • scale()
  • skew()
  • matrix()

What is the correct syntax for the geolocation API?

navigator.geolocation.getCurrentPosition(function (pos) {
    alert("yallo... your determined position is: " +
    pos.coords.longitude + " / " + pos.coords.latitude);
});

What are Webworkers?

Web Workers allow you to do things like fire up long-running scripts to handle computationally intensive tasks, but without blocking the UI or other scripts to handle user interactions.

How do you instantiatea Webworker?

var worker = new Worker('task.js');

How do you start a webworker?

worker.postMessage(); // Start the worker.

What does the webworker have to implement to be callable?

When postMessage() is called from the main page, our worker handles that message by defining an onmessage handler for the message event. The message payload (in this case 'Hello World') is accessible in Event.data.

How do you stop a webworker?

There are two ways to stop a worker: by calling worker.terminate() from the main page or by calling self.close() inside of the worker itself.

What is the structure of an appcache manifest file?

CACHE MANIFEST

Cache

Network

Fallback

What is the notation for the Fallback section of the Appcache manifest?

# static.html will be served if main.py is inaccessible
# offline.jpg will be served in place of all images in images/large/
# offline.html will be served in place of all other .html files
FALLBACK:
/main.py /static.html
images/large/ images/offline.jpg
*.html /offline.html