A small jQuery extension for trapping/handling custom protocol schemes
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
.DS_Store
README
jquery-protokol.js

README

$.Protokol

file: jquery-protokol.js
Copyright 2010 Francois Lafortune "quickredfox"
MIT Licensed;

A small jQuery extension for trapping/handling custom protocol schemes

USAGE:

	// Every clicked anchors whose href  starts with 'przd://' will be trapped
	// and re-bound to custom handler (can have multiple handlers)
	
	$.Protokol.register('przd' ,'click', function customClickHandler(data){
		var element = data.element;
		var event = data.event;
		var protocol = data.protocol;
	});
	
	// Stop listening for this protocol (removes all handlers bound by "register" )
	$.Protokol.unregister('przd' ,'click');
	
	// Every form submit whose action starts with 'przd://' will be trapped
	// and re-bound to custom handler (can have multiple handlers)

	$.Protokol.register('przd' ,'submit', function customSubmitHandler(data){
		var element = data.element;
		var event = data.event;
		var protocol = data.protocol;
	});

	// Stop listening for this protocol (removes all handlers bound by "register" )
	$.Protokol.unregister('przd' ,'submit');
	
	
TODO: 

	- add support for resource fetching/linking via custom schemes