Skip to content

Quantomic/metaphorjs-history

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

33 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#MetaphorJs stateless pushState wrapper/polyfill

3kb minified

without MetaphorJs:

history.initPushState()

history.onChange(function(location){})

history.onBeforeChange(function(location){})

history.pushState(state, title, url) -- state and title are ignored

history.replaceState(state, title, url) -- state and title are ignored

with MetaphorJs:

history.initPushState()

MetaphorJs.on("beforeLocationChange", function(location){})

MetaphorJs.on("locationChange", function(location){})

MetaphorJs.pushUrl(url)

MetaphorJs.replaceUrl(url)

MetaphorJs.currentUrl()

==============

IE6+, Chrome, Firefox, Safari, Opera

If browser does not support pushState, #! will be used.

All links with valid url in href will be subject to pushState handler.

If you want to bypass handler, add target="_self" attribute (or any other target value).

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%