# Rails3 and unobtrusive javascript

**URL:** <https://www.ruby-forum.com/t/rails3-and-unobtrusive-javascript/194160>\
**Category:** Rails\
**Created:** [August 31, 2010, 12:13pm UTC](https://www.ruby-forum.com/t/rails3-and-unobtrusive-javascript/194160 "2010-08-31T12:13:28Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![msan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ab097/32.png) [@msan](https://www.ruby-forum.com/u/msan)\
**Post date:** [August 31, 2010, 12:13pm UTC](https://www.ruby-forum.com/t/rails3-and-unobtrusive-javascript/194160/1 "2010-08-31T12:13:28Z")

</div>

Ok to not depend on a specific javascript framework but now its’ hard  
for me to reproduce the same behavior of some helpers like  
observe\_field.  
I’ve found some jquery examples but all use the event change that is  
triggered only when the text field loses focus.  
It’s not the same behavior as observe\_field.  
There is someone in the same situation?

---

<div class="post-metadata">

**Author:** ![msan](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/3ab097/32.png) [@msan](https://www.ruby-forum.com/u/msan)\
**Post date:** [August 31, 2010, 11:23pm UTC](https://www.ruby-forum.com/t/rails3-and-unobtrusive-javascript/194160/2 "2010-08-31T23:23:32Z")

</div>

Msan M. wrote:

> Ok to not depend on a specific javascript framework but now its’ hard  
> for me to reproduce the same behavior of some helpers like  
> observe\_field.  
> I’ve found some jquery examples but all use the event change that is  
> triggered only when the text field loses focus.  
> It’s not the same behavior as observe\_field.  
> There is someone in the same situation?

Unobtrusive JavaScript and JavaScript agnosticism are really two  
separate and unrelated issues.

Unobtrusive JavaScript is the “new hotness” because from a design  
standpoint it makes a lot of sense. From what I can gather it seems that  
most developers are trending away from the built-in helpers and doing  
more with pure JavaScript.

I’ve not worked with Rails 3’s unobtrusive JavaScript to know the issues  
involved. Bu, I do use unobtrusive techniques wherever possible, which  
seems to be pretty much everywhere.
