# Ajax not defined

**URL:** <https://www.ruby-forum.com/t/ajax-not-defined/163638>\
**Category:** Rails\
**Created:** [March 23, 2009, 1:52pm UTC](https://www.ruby-forum.com/t/ajax-not-defined/163638 "2009-03-23T13:52:13Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![intern\_ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/dc4da7/32.png) [@intern\_ruby](https://www.ruby-forum.com/u/intern_ruby)\
**Post date:** [March 23, 2009, 1:52pm UTC](https://www.ruby-forum.com/t/ajax-not-defined/163638/1 "2009-03-23T13:52:13Z")

</div>

This is my code and I am trying to call remote function when somebody  
click on add button after selecting something from select\_tag. Please  
tell me where I am wrong ? I am getting following error: Ajax not  
defined.

\<%= select\_tag ‘available\_line\_id[]’,options\_for\_select(customers),{:id  
=\> ‘available\_line\_id’,:multiple =\> true, :size =\> 13, :style =\> ‘width:  
225px;’} %\>

Thanks,

---

<div class="post-metadata">

**Author:** ![intern\_ruby](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/i/dc4da7/32.png) [@intern\_ruby](https://www.ruby-forum.com/u/intern_ruby)\
**Post date:** [March 23, 2009, 2:14pm UTC](https://www.ruby-forum.com/t/ajax-not-defined/163638/2 "2009-03-23T14:14:48Z")

</div>

On Mar 23, 12:52 pm, Intern ruby [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid)  
wrote:

> This is my code and I am trying to call remote function when somebody  
> click on add button after selecting something from select\_tag. Please  
> tell me where I am wrong ? I am getting following error: Ajax not  
> defined.

Probably means that your page doesn’t load the prototype javascript  
library (which is the thing that adds the Ajax object). See  
javascript\_include\_tag

Fred
