-
-
Save cschneid/77c51808d1890814b024 to your computer and use it in GitHub Desktop.
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
<html> | |
<body> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js" type="text/javascript"></script> | |
<script src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/jquery-ui.min.js" type="text/javascript"></script> | |
<script type="text/javascript"> | |
$.widget("cb.hello", { | |
_init: function(){ | |
alert("Hello Widget Ran"); | |
} | |
}); | |
$(function(){ | |
$("#thing").hello(); | |
}); | |
$.cb.hello.prototype // => is that widget | |
$.ui.hello.prototype // => null. | |
// Namespaces only affect the spot in the heirarchy where the widget code | |
// gets put. There's still a giant name collision waiting to happen with the | |
// name of the widget itself (`hello` in this case). | |
</script> | |
<div id="thing">Attach hello to me please</div> | |
</body> | |
</html> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment