Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8896211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:58:54+00:00 2026-06-14T23:58:54+00:00

I am doing an jquery ajax call in my rails application and in the

  • 0

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??

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T23:58:55+00:00Added an answer on June 14, 2026 at 11:58 pm

    Seems like you have got some issues with escaping characters.

    This is a working DEMO

    I’m using below code which works fine:

    data = "<script>alert('test');<\/script><p>Dynamic Content with Script</p>"
    $('#paste').html(data);​
    

    However, it’ll alert even without escaping script tag but will not render and execute it in DOM which I guess highlights your problem.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm doing an jQuery ajax call to an XML page in my CakePHP site.
Not sure what I'm doing wrong but I can't get my JQuery AJAX call
I am doing an AJAX call that returns some HTML and jQuery: <div id='selected'>Here
I'm doing a jQuery Ajax call to a PHP script that returns this string
The scenario I'm getting a page by JQuery ajax call, and show as a
I am doing an AJAX call to a controller method on my ASP.Net MVC
I am doing Ajax call using jQuery and my URL is like http://localhost;3327/DummyAps/Demo.aspx In
I'm doing a jQuery AJAX post like this: var form = $(#formid); form.submit(function() {
I'm doing an ajax request through jQuery and for example, my URL is http://test.com/query.php?hello=foo
I have some jquery code that is doing an ajax lookup and returning comma

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.