Forum: Ruby on Rails insert the javascript codes of another view returned from ajax to a view page

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
Ecec81af7caddc8730eee285475df4da?d=identicon&s=25 ruby rails (rubyonrails)
on 2012-11-17 15:08
Hi,
I am doing an jquery ajax call in my rails application and in the
controller I am rendering it to a view page(where javascripts codes are
written). Then I need to insert the response returned from the server to
a DOM element. When I try to alert the server response (alert (data))I
am getting it completely. But when I insert it into the dom
element($('#someid').html(data)) it is not inserting it completely as it
contains lot of javascript codes. So can anyone please tell me how to
insert the javascript codes of another view returned from ajax to a view
page??
This topic is locked and can not be replied to.