Txt

Byte sized tech know-how.

  • Home
  • About

Tag Archives: return

28 Oct

Chainable interface in JavaScript

Creating Chainable interfaces in javascript…


(function() {
	function _init() {
		return this;
	}
	
	_init.prototype = {
		"myFunction": function() {
			return this;
		}
		
		// Put all the functions here - make sure all 'return this;'
	}
	
	chainer = function() {
		return new _init();
	}
})();

Roll out your own JavaScript Interfaces

[tags][/tags]

admin Posted in Code, JavaScript chain, interface, JavaScript, jquery, js, return, this Leave a comment

Post navigation

Categories

  • Code
  • Command Line
  • Configuration
  • CSS
  • HTML
  • internet
  • JavaScript
  • Linux
  • Mobile
  • Perl
  • PHP
  • Python
  • Ruby
  • Uncategorized

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org
Fruitful theme by fruitfulcode Powered by: WordPress
↑