Skip to content

Instantly share code, notes, and snippets.

$(function(){ // Data-binding function
$.getJSON('a42580.json',function(d){ // Get details from the JSON file
$('#movie').text(d.title);
$('#screen').text(d.screen);
$('#rating').text(d.rating);
$('#runtime').text(d.runtime);
$('#date').text(d.date);
////////////////////////////////////////////////
// 1 -- How Would you print the country of the variable city?
////////////////////////////////////////////////
var city = {name: "London", country: "UK"};
// city.country;
@wb4r
wb4r / albums.json
Last active March 29, 2016 16:35
albums for MusicApp
[
{
"artist": "Tori Kelly",
"title": "Unbreakable Smile",
"url": "https://itunes.apple.com/us/album/unbreakable-smile-bonus-track/id988591612?v0=WWW-NAUS-ITSTOP100-ALBUMS&l=en&ign-mpt=uo%3D4",
"date": "Jun 23, 2015",
"cover": "http://a5.mzstatic.com/us/r30/Music5/v4/83/10/90/83109037-0c67-bf88-a2c5-a022b21de7d7/cover170x170.jpeg",
"price": 12.99
}, {
"artist": "Taylor Swift",
2016-02-29T21:36:19.668818+00:00 heroku[router]: at=info method=GET path="/css/vendor/backbone.modal.theme.css" host=pure-river-85638.herokuapp.com request_id=d4764083-8e82-462d-9bb8-aee383a4bd7c fwd="213.152.161.35" dyno=web.1 connect=1ms service=2ms status=304 bytes=178
2016-02-29T21:36:19.651712+00:00 heroku[router]: at=info method=GET path="/css/vendor/backbone.modal.css" host=pure-river-85638.herokuapp.com request_id=562feef9-b283-4acc-9142-2ddf08565bf5 fwd="213.152.161.35" dyno=web.1 connect=2ms service=2ms status=304 bytes=176
2016-02-29T21:36:19.637946+00:00 heroku[router]: at=info method=GET path="/css/vendor/bootstrap.css" host=pure-river-85638.herokuapp.com request_id=cab133f2-742c-451f-8b66-6a1c02d48a08 fwd="213.152.161.35" dyno=web.1 connect=1ms service=4ms status=304 bytes=179
2016-02-29T21:36:19.674544+00:00 heroku[router]: at=info method=GET path="/js/vendor/jquery-ui.min.js" host=pure-river-85638.herokuapp.com request_id=8a5fbe31-1d3b-4be5-83ff-59720dc807eb fwd="213.152.161.35" dyno=web.1 con
@wb4r
wb4r / cities.json
Created February 25, 2016 17:37
larger file
[
{
"city": "New York",
"growth_from_2000_to_2013": "4.8%",
"latitude": 40.7127837,
"longitude": -74.0059413,
"population": "8405837",
"rank": "1",
"state": "New York"
},
@wb4r
wb4r / views.js
Created February 25, 2016 14:55
backbone collection selection
App.ResultView = Marionette.ItemView.extend({
template: "#js-result",
})
App.ResultsView = Marionette.CompositeView.extend({
tagName: "ul",
// className: ".suggestions",
childView: App.ResultView,
template: "#js-results",
// this.listenTo("show", this.filter()),
@wb4r
wb4r / cities.json
Last active February 25, 2016 11:23
[
{
"city": "New York",
"growth_from_2000_to_2013": "4.8%",
"latitude": 40.7127837,
"longitude": -74.0059413,
"population": "8405837",
"rank": "1",
"state": "New York"
},
THIS AND $(THIS) IN JAVASCRIPT AND jQuery
by Willem T for LauchSchool.com – FE2 Assessment 249
–---- Definition –----
@wb4r
wb4r / JavaScript-myNotes.js
Last active January 23, 2016 12:33
Notes and Shortcuts to JavaScript
:::::::::::::::::::::::::::::::::::::::::::::
::::::::::::::::::: INDEX :::::::::::::::::::
:::::::::::::::::::::::::::::::::::::::::::::
1- PRIMITIVES VS. OBJECTS
2- NULL VS. UNDEFINED
3- FUNCTION DECLARATION AND FUNCTION EXPRESSION
4- JS FUNCTION-S: FIRST CLASS VALUES
5- ANONYMOUS FUNCTIONS, SCOPE AND CLOSURE
6- FUNCTION EXPRESSION WITH GROUPING OPERATORS