# Prototype & scriptaculous js lib loading error

**URL:** <https://www.ruby-forum.com/t/prototype-scriptaculous-js-lib-loading-error/148482>\
**Category:** Rails\
**Created:** [September 13, 2008, 11:20am UTC](https://www.ruby-forum.com/t/prototype-scriptaculous-js-lib-loading-error/148482 "2008-09-13T11:20:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [September 13, 2008, 11:20am UTC](https://www.ruby-forum.com/t/prototype-scriptaculous-js-lib-loading-error/148482/1 "2008-09-13T11:20:31Z")

</div>

I am trying to incorporate a js widget into my webapp…

the html file widget is running fine in my browsers (FF3, Safari  
3…) , the js lib loading is defined as folloing :

I tried to run it into my Rails app as it (just changing the  
directory, and adding the dragdrop.js I need)

I got it, BUT there is one js error in the console (so a button is not  
displayed…)

Error : Element.display is not a function

which is on the line trying to display the button ,

Element.display(this.forwardElement, this.navScrollIndex \<=  
this.items.length - (this.setSize+1));

I already have seen this kind of error, and I wonder if it’s not  
linked to scriptaculous lib loading ?

any clue ?

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [September 13, 2008, 11:41am UTC](https://www.ruby-forum.com/t/prototype-scriptaculous-js-lib-loading-error/148482/2 "2008-09-13T11:41:01Z")

</div>

Got it, the widget is using Prototype 1.6.0 where the display function  
IS defined :

display: function(element, bShow) {  
if(bShow) { Element.show(element); } else  
{ Element.hide(element); }  
},

but my Rails app is using Protoype 1.6.0.2 where this function IS NOT  
defined, is it a bug or not ??

---

<div class="post-metadata">

**Author:** ![kadoudal](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f0a364/32.png) [@kadoudal](https://www.ruby-forum.com/u/kadoudal)\
**Post date:** [September 13, 2008, 11:56am UTC](https://www.ruby-forum.com/t/prototype-scriptaculous-js-lib-loading-error/148482/3 "2008-09-13T11:56:48Z")

</div>

On Sep 13, 10:40 am, Erwin [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Got it, the widget is using Prototype 1.6.0 where the display function  
> IS defined :
> 
> display: function(element, bShow) {  
> if(bShow) { Element.show(element); } else  
> { Element.hide(element); }  
> },
> 
> but my Rails app is using Protoype 1.6.0.2 where this function IS NOT  
> defined, is it a bug or not ??

Well it’s not in the prototype api docs. There’s nothing stopping you  
just sticking that function in though.

Fred
