Skip to content

Instantly share code, notes, and snippets.

@dwheeler
Created September 20, 2011 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dwheeler/1230124 to your computer and use it in GitHub Desktop.
Save dwheeler/1230124 to your computer and use it in GitHub Desktop.
doWhen Example 4
<script type="text/javascript" src="http://code.jquery.com/jquery-1.6.4.min.js" /> <script type="text/javascript">
var checkJQLoaded = function(){ return (typeof $ != 'undefined')};
var myScope = {target:"#myDiv"};
SUGAR.util.doWhen(checkJQLoaded, function(toAppend){
$(this.target).append(toAppend);
}, "Hello World", myScope);
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment