# "Ajax is not defined" problem

**URL:** <https://www.ruby-forum.com/t/ajax-is-not-defined-problem/138073>\
**Category:** Rails\
**Created:** [May 20, 2008, 12:33am UTC](https://www.ruby-forum.com/t/ajax-is-not-defined-problem/138073 "2008-05-20T00:33:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![gringo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f19dbf/32.png) [@gringo](https://www.ruby-forum.com/u/gringo)\
**Post date:** [May 20, 2008, 12:33am UTC](https://www.ruby-forum.com/t/ajax-is-not-defined-problem/138073/1 "2008-05-20T00:33:49Z")

</div>

Hello,

I want to call Ajax.Request from my javascript function defined in “/  
javascripts/application.js” but I still get the same error on my  
firebug console: “Ajax is not defined”.  
As I know Ajax class is defined in /javascripts/prototype.js library  
which is within the same dir as my script.  
Both scripts has been also included on the generated page - I have  
checked it on the page source.

Is there something missed?

Thanks  
gringo

---

<div class="post-metadata">

**Author:** ![gringo](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/g/f19dbf/32.png) [@gringo](https://www.ruby-forum.com/u/gringo)\
**Post date:** [May 20, 2008, 1:40am UTC](https://www.ruby-forum.com/t/ajax-is-not-defined-problem/138073/2 "2008-05-20T01:40:00Z")

</div>

Do \<%= javascript\_include\_tag :defaults %\> on your page rather than  
including both files.

It sounds to me like it’s not including the prototype one.

On Tue, May 20, 2008 at 8:02 AM, gringo [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> Is there something missed?
> 
> Thanks  
> gringo
> 
> >

–  
Appreciated my help?  
Reccommend me on Working With Rails  
[http://workingwithrails.com/person/11030-ryan-bigg](http://workingwithrails.com/person/11030-ryan-bigg)
