Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

hakubo/Hasher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

History

8 Commits

Repository files navigation

#Hasher

This is a simple helper that let's you react to hash changes and make this changes

This lets you have full history so user can go back and forward in their browsers and your app can react to this!

#Use

To listen to changes, it is as simple as calling:

Hasher({
	'hashName': function(){
		//and a callback
	},
	'moreHashNames': function(){
	
	},
	'': function(){
		//this will be called if there is no hash
	}
})

to change hash you can simply call:

Hasher('hashName');

Isn't that simple ?

This way you can very simply build one page web apps / sites.

Hasher accepts second parameter as well that contains additional options

Hasher({},{
	default: function(){
		//this will be run if hash does not match any specified
	},
	beforeEach: function(){
		//this will run before each callbacks on hash change
	}
})

Enjoy!

Licence

Use as is 
	Share however you want
		Feel free to change and experiment

About

Simple helper with hash changes

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

AltStyle によって変換されたページ (->オリジナル) /