This file contains hidden or 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> | |
| <link rel="stylesheet" href="base.css" /> | |
| <link rel="stylesheet" href="mobile.css" media="max-width: 320px" /> | |
| <!-- OR --> | |
| <style type="text/css"> | |
| /* base styles go here */ | |
| @media (max-width: 320px) |
This file contains hidden or 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
| $.fn.disable = function() { | |
| return this.filter(':input').each(function() { | |
| $(this).attr('disabled', 'disabled'); | |
| }); | |
| }; |
This file contains hidden or 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($) { | |
| $.fn.enable = function() { | |
| // Enable each selected element by removing its 'disabled' attribute. | |
| return this.each(function() { | |
| $(this).removeAttr('disabled'); | |
| }); | |
| }; | |
| $.fn.disable = function() { |
This file contains hidden or 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(m) { | |
| m.doStuff = function() { | |
| // TODO: Stuff | |
| }; | |
| })(window.deeply.nested.module); | |
| window.deeply.nested.module.doStuff(); |
This file contains hidden or 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(module, undefined) { | |
| // Anything declared at this level is only accessible within this | |
| // function. Efectively, they will be the module's private variables. | |
| var _answer = 42; | |
| // The module's public interface is then defined by declaring variables on | |
| // the module variable that was passed in. | |
| module.getAnswer = function(question) { |
This file contains hidden or 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 createPerson = function(name) { | |
| var _name = name; | |
| return { | |
| getName: function() { | |
| return _name; | |
| } | |
| }; | |
| }; |
This file contains hidden or 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 message = 'Hello!'; | |
| (function () { | |
| var message; | |
| alert(message); | |
| message = 'Hi!'; | |
| })(); |
This file contains hidden or 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 message = 'Hello!'; | |
| (function() { | |
| alert(message); | |
| var message = 'Hi!'; | |
| })(); |
This file contains hidden or 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 message = 'Hello!'; | |
| (function() { | |
| var message = 'Hi!'; | |
| alert(message); | |
| })(); |
This file contains hidden or 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 gistPrefix = 'http://gist.github.com/', | |
| // Cache document.write so that it can be restored once all Gists have been | |
| // embedded. | |
| cachedWrite = document.write, | |
| body = $('body'), | |
| // Map each p.gist to an object that contains the paragraph to be replaced | |
| // and the Gist's identifier. | |
| gists = $('p.gist').map(function(n, p) { | |
| p = $(p); |