domTT and prototype.js

58 views
Skip to first unread message

James Abbott

unread,
Oct 22, 2006, 11:24:25 AM10/22/06
to dom-t...@googlegroups.com
Hello,

I'm trying to ajaxify an existing webap which makes extensive use of
domTT for it's tooltips. In the interest of not reinventing wheels,
I'm trying to use the prototype library (from prototype.conio.net),
but simply including the prototype library (without trying to use any
of it's methods) alongside the domTT libraries breaks domTT. In
firefox 1.5.0.7, moving the mouse around over the active browser
window produces a stream of 'Hash is not a constructor' (domLib.js
line: 543) javascript errors, and the tooltips do not work.

The following minimal page is enough to cause the errors (pre tags excepted...)

<pre>
<html>
<head>
<script type="text/javascript" src="domTT/domLib.js"></script>
<script type="text/javascript" src="domTT/domTT.js"></script>
<script type="text/javascript" src="domTT/fadomatic.js"></script>
<script type="text/javascript" src="js/prototype.js"></script>
</head>
<body><h1>body</h1></body>
</html>
</pre>

Is there a known conflict between these two libraries, or should they
happily work alongside each other?

Cheers,
James

Dan Allen

unread,
Oct 23, 2006, 5:43:11 AM10/23/06
to dom-t...@googlegroups.com
Yes, this is a known problem because both projects choose to use the
name Hash for a top-level function. Until the next version of domTT,
which will resolve this issue, the solution is to replace all
instances of "new Hash" with "new domTT_Hash" in domTT.js and replace
"function Hash" with "function domTT_Hash" in domLib.js. That should
solve your problem.

/dan


--
Daniel Allen
Registered Linux User #231597

Mojavelinux.com: Open Source Advocacy
http://www.mojavelinux.com

While I make a strong effort to keep up with my email on a daily basis,
life and work come first and, at times, keep me away from my mail for a
while. If you contact me and then don't hear back for more than a week,
it is very likely that I am excessively backlogged or the message was
caught in the filters. Please don't hesitate to resend a message if
you feel that it did not reach my attention.

James Abbott

unread,
Oct 23, 2006, 8:28:53 AM10/23/06
to dom-t...@googlegroups.com
Ah - great. That explains it...

Thanks for your help,
James

Reply all
Reply to author
Forward
0 new messages