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 animal = { | |
name: 'Karl', | |
type: 'cat', | |
color: 'black', | |
age: 7 | |
}; | |
//convert JSON animal into a string | |
var dehydratedAnimal = JSON.stringify(animal); |
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 () { | |
$('input[type=checkbox]').ioscheckbox(); | |
}); |
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
<!doctype html> | |
<html> | |
<head> | |
<link href="ios-checkbox.css" type="text/css" rel="stylesheet"> | |
</head> | |
<body> | |
<!-- Your awesome website goes here... --> |
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
$(window).on('message', function (event) { | |
}); |
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
//postMessage using an iFrame | |
var iframe = document.getElementById('my-iframe').contentWindow; | |
iframe.postMessage('good morning', 'http://jeffbail.com/'); | |
//postMessage using a Window | |
var win = window.open('http://someawesomeurl.com', 'someawesomeurl'); | |
win.postMessage('good evening', 'http://jeffbail.com/'); |
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 article = document.getElementById('article'); | |
var p = article.querySelector('p'); //returns the first 'p' tag that's a child of the #article element | |
p = article.querySelectorAll('p'); //returns a NodeList containing all 'p' tags that are children of the #article element |
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
<div class="info"> | |
<p class="name">Jeff Bail</p> | |
<p class="address"> | |
<span class="street">123 Awesome Ave</span> | |
<span class="city-state">Denver, CO</span> | |
<span class="country">United States</span> | |
</p> | |
<p class="tel">(XXX) XXX-XXXX</p> | |
</div> |
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
<div class="info"> | |
<p class="name">Jeff Bail</p> | |
<p class="address"> | |
<span class="street">123 Awesome Ave</span> | |
<span class="city-state">Denver, CO</span> | |
<span class="country">United States</span> | |
</p> | |
<p class="tel">(XXX) XXX-XXXX</p> | |
</div> |
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
<p><strong>Example 1</strong>: The link below will look good when hovered because the outline doesn't take up space.</p> | |
<p><a href="#" class="outline">I'm jumpy</a></p> |
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
<p><strong>Example 1</strong>: The link below will be jumpy when hovered because borders take up space and there are none defined for the "off" state.</p> | |
<p><a href="#" class="border-jumpy">I'm jumpy</a></p> | |
<p><strong>Example 2</strong>: The link below has a transparent border in the "off" state, so it won't be jumpy when hovered.</p> | |
<p><a href="#" class="border-calm">I'm calm</a></p> |
NewerOlder