new problem with old prototype jquery conflict fix

31 views
Skip to first unread message

anodyne

unread,
Jan 19, 2012, 10:49:55 AM1/19/12
to libra...@googlegroups.com
My library OPAC (SirsiDynix e-Library) uses the prototype javascript library.  To add a chat widget to the e-Library I've used the jQuery.noConflict() function to resolve the problem caused by LibraryH3lp's use of the jQuery and both JS libraries using the $ as an object alias.

This worked fine until recently.  Now I think there is a race condition where jQuery.noConflict() is being called before the jQuery the widget and jQuery library are fully loaded. 

Anyone else having this problem?  Got a fix?

Thanks,

Travis Lloyd

Web Services Coordinator
Kanawha County Public Library
123 Capitol Street
Charleston WV, 25301

Amy Shelton

unread,
Feb 1, 2012, 2:35:04 PM2/1/12
to libra...@googlegroups.com
Hi Travis,

Nice to meet you! Back when we introduced the new widget designer for the admin site, we made a small change that ensures the libraryh3lp.js script waits until the page is loaded before running. You might give this a try in place of your current script line:

<!-- Place this script as near to the end of your BODY as possible. -->
<script type="text/javascript">
 (function() {
   var x = document.createElement("script");
   x.type = "text/javascript";
   x.async = true;
   x.src = (document.location.protocol === "https:" ? "https://" : "http://") + "libraryh3lp.com/js/libraryh3lp.js?multi";
   var y = document.getElementsByTagName("script")[0];
   y.parentNode.insertBefore(x, y);
 })();
</script>

Not sure how the above will come out. Will try to repost if it gets garbled.

Hope that helps,
Amy Shelton
LibraryH3lp

Reply all
Reply to author
Forward
0 new messages