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
Stream URL: rtmp://rtmp-api.facebook.com:80/rtmp/389171898089182?ds=1&s_l=1&a=ATipJJZm6SMHA-jU | |
Server URL: rtmp://rtmp-api.facebook.com:80/rtmp/ | |
Stream Key: 389171898089182?ds=1&s_l=1&a=ATipJJZm6SMHA-jU |
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
var aladdin = document.querySelector(".aladdin"); | |
var terminator = document.querySelector(".terminator"); | |
aladdin.addEventListener("click", getMovie); | |
terminator.addEventListener("click", getMovie); | |
// ...and so on for each movie | |
// One event handler to rule them all... | |
function getMovie(event) { | |
var clickedMovie = event.target; |
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
// Assuming there's an <img class="aladdin"> on the page... | |
var aladdin = document.querySelector(".aladdin"); | |
aladdin.addEventListener("click", getAladdin); | |
// You'll have multiple event handlers... | |
function getAladdin(event) { | |
$.get("http://omdbapi.com/?i=tt0103639", displayResults); | |
} |
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
$.get("http://omdbapi.com/?i=tt0103639", displayResults); | |
function displayResults(results) { | |
console.log(results.Title); | |
console.log(results.Year); | |
console.log(results.Rated); | |
console.log(results.Runtime); | |
console.log(results.Plot); | |
} |
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
<head> | |
<meta charset="utf-8"> | |
<title>Movie Favorites</title> | |
<link rel="stylesheet" href="styles.css" media="screen"> | |
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.1.1/jquery.min.js"></script> | |
</head> |
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
{ | |
"name": "Avand Amiri", | |
"bio": "Hi there, my name is Avand!", | |
"image": "http://avandamiri.com/images/avand.jpg" | |
} |
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
// This is a string... (looks like a list but still a string) | |
var animalsString = "cow,dog,horse,moose,rooster"; | |
// Turn the string into an array... | |
var animalsArray = animalsString.split(","); | |
// Now you can go about looping, like normal... | |
for (var i = 0; i < animalsArray.length; i++) { | |
// animalsArray[i] | |
} |
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
input:checked + span { | |
opacity: 0.2; | |
text-decoration: line-through; | |
} |
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
document.querySelector("form").addEventListener("submit", search); | |
function search(event) { | |
event.preventDefault(); | |
var query = document.querySelector("#query").value; | |
var url = "http://omdbapi.com/?s=" + query; | |
// Check local storage to see if the results have already been | |
// retrieved with the URL as the key... |
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
// This would be so much easier to read and write... | |
var position = navigator.geolocation.getCurrentPosition(); | |
console.log(position.coords.latitude); | |
// So why in the world do we have to write this? | |
navigator.geolocation.getCurrentPosition(function(position) { | |
console.log(position.coords.latitude); | |
}); |
NewerOlder