# Executing javascript in the responseText

**URL:** <https://www.ruby-forum.com/t/executing-javascript-in-the-responsetext/109655>\
**Category:** Rails\
**Created:** [July 17, 2007, 4:34pm UTC](https://www.ruby-forum.com/t/executing-javascript-in-the-responsetext/109655 "2007-07-17T16:34:30Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Love\_AJAX](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/l/779978/32.png) [@Love\_AJAX](https://www.ruby-forum.com/u/Love_AJAX)\
**Post date:** [July 17, 2007, 4:34pm UTC](https://www.ruby-forum.com/t/executing-javascript-in-the-responsetext/109655/1 "2007-07-17T16:34:30Z")

</div>

Hi,

Is there a way of executing javascript in the responseText?

I have a controller action that sends some javascript as part of a  
partial to the browser. But it won’t get executed after the browser  
receives it. One option is to use RJS but I am reusing this same  
partial in other places. So I can’t replace this partial with an RJS.  
Do I have any other options?

Thanks  
-subbu
