Return to Snippet

Revision: 32224
at September 21, 2010 14:01 by AaronPresley

Initial Code
<script src="" type="text/javascript"></script>
<script type="text/javascript">
 	helloWorld : function(options) {
		// define some default variables in case none are passed in
		var defaults = {
			foo: 'hello ',
			bar: ' world'
	  var options = $.extend(defaults, options);
	  return this.each(function() {
			 // apply any manipulations to the selected object by simply using the $(this) selector
	// if you needed to add more methods (functions) to your plugin, you would uncommment the comma on the line above
	// and simply add another function similar to our helloWorld function above.


	//outputs "hello world" #test
	$('#test2').helloWorld({foo:'good ', bar:' bye'});
	//outputs "good bye" into #test2

Initial URL

Initial Description

Initial Title
jQuery Plugin Template

Initial Tags
textmate, plugin, jquery

Initial Language