Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
A small jQuery extension for trapping/handling custom protocol schemes
branch: master

Fetching latest commit…

Cannot retrieve the latest commit at this time

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
Something went wrong with that request. Please try again.