Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
36 lines (26 sloc) 1007 Bytes
<title>jQuery Plugin Patterns</title>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src=""></script>
<script type="text/javascript" src="patterns/jquery.widget-factory.bridge.boilerplate.js"></script>
<script type="text/javascript">
// connect the widget obj to jQuery's API under the "foo" namespace
$.widget.bridge("foo", widgetName);
// create an instance of the widget for use
var instance = $('body').foo({
baz: true
// your widget instance exists in the elem's data
console.log("foo").element); // => #elem element
// bridge allows you to call public methods..."publicFunction"); // => "public method"
// bridge prevents calls to internal methods"_privateFunction"); // => #elem element
Something went wrong with that request. Please try again.