This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function(){ | |
window.myObject = { | |
sayHello: function () { | |
console.log('Hello world'); | |
} | |
} | |
myObject.sayHello(); | |
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;(function(){ | |
window.myObject.prototype = { | |
sayHello: function () { | |
console.log('Hello world'); | |
} | |
} | |
myObject.sayHello(); | |
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<li>Item 1</li> | |
<li>Item 2</li> | |
. | |
. | |
. | |
<li>Item 10,000</li> | |
</ul> | |
Given the above, write some code that would console.log the list item's innerHTML when any of the list items is clicked. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul> | |
<li>Item 1</li> | |
<li>Item 2</li> | |
. | |
. | |
. | |
<li>Item 10,000</li> | |
</ul> | |
Given the above, write some code that would console.log the list item's innerHTML when any of the list items are clicked. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<ul id="foo"> | |
<li>Item 1</li> | |
<li>Item 2</li> | |
. | |
. | |
. | |
<li>Item 10,000</li> | |
</ul> | |
Given the above, write some code that would console.log a list item's contents when any of them are clicked. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Javascript - reference https://developer.mozilla.org/en/JavaScript/Reference | |
Comments | |
Variables | |
- can store any value | |
Types | |
Number | |
String | |
Boolean | |
Object | |
Null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CSS | |
Css is for presentation | |
External vs Internal vs Inline | |
Selectors (css2) - http://www.w3.org/TR/CSS2/selector.html | |
Universal: * | |
Type: body | |
Descendant: body div | |
Child: body > div | |
Class: .myclass | |
ID: #myId |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE PROCEDURE geodist (IN userid int, IN dist int) | |
BEGIN | |
declare mylon double; | |
declare mylat double; | |
declare lon1 float; | |
declare lon2 float; | |
declare lat1 float; | |
declare lat2 float; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// At a glance you can see which global objects are being imported, these are the local variable names you will use in your script | |
(function(z, $) { // encapsulate in a closure | |
// Use strict is within scoped function so that it only applies to this code block | |
"use strict"; // Prevents common errors and bad practices, by catching them at runtime. | |
var proto; // The var that will store the reference to the prototype for our widget | |
/** | |
* Description of what the widget does | |
* | |
* @example | |
* z.myWidget({ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function(){ | |
var test = function() { | |
}, | |
proto = test.prototype; | |
proto.method = function() { | |
}; | |
}()); |
OlderNewer