blixt / js-hash

A JavaScript library that keeps track of the history of changes to the hash part in the address bar.
http://blixt.org/js
70 stars 14 forks source link

conflicts with prototype.js #3

Open kirs opened 13 years ago

kirs commented 13 years ago

prototype.js line 1214: function $H(object) { return new Hash(object); };

If I include prototype and js-hash to my page, Chrome console prints: prototype.js:1216 Uncaught TypeError: object is not a function

scq commented 13 years ago

Prototype.js creates a global object called Hash. This is an issue with prototype, not js-hash. If you want to make js-hash work with prototype, go to line 37 of Hash.js, and replace

var Hash = (function () {

with

var jshash= (function () {

and just use jshash.init, jshash.go, etc instead of Hash.init, Hash.go, etc