Skip to content

Instantly share code, notes, and snippets.

@y0n3r
Created July 24, 2014 20:27
Show Gist options
  • Save y0n3r/f277feeeb29a2878603d to your computer and use it in GitHub Desktop.
Save y0n3r/f277feeeb29a2878603d to your computer and use it in GitHub Desktop.
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-1.9.1.min.js"></script>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
<button>Click me.</button>
</body>
</html>
var changeDom = $.Deferred();
changeDom.done(function() {
console.log("Consider this application logic: changeDom resolved.");
});
$("button").click(function() {
changeDom.resolve();
});
changeDom.done(function() {
$("button").css("color", "red");
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment