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

  • SEARCH
  • Home
  • 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 7825687
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T09:06:53+00:00 2026-06-02T09:06:53+00:00

I have the following jquery: $.ajax({ url: href, context: document.body, success: function (data) {

  • 0

I have the following jquery:

$.ajax({
        url: href,
        context: document.body,
        success: function (data) {
            alert(data);
            // Prepare & show dialog
            $(dialogDiv).find('.modal-body p.body').html(data);
            ...

I have some html in ‘data’. I’m sure because I display it in an alert box. I try to inject this html with the last line in the script above. When I inspect the DOM, I don’t see my html in it.

Any idea?

Thanks.

  • 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-02T09:06:55+00:00Added an answer on June 2, 2026 at 9:06 am

    if you defined dialogDiv before ajax call (meaning it will be global inside the response method) then why you don’t just use

    dialogDiv.find('.modal-body p.body').html(data);

    instead of

    $(dialogDiv).find('.modal-body p.body').html(data);

    Also make sure that .modal-body p.body actually exist before showing the popup.
    I’m guessing, that your dialog box creates its markup when you showing (or initializing) it.
    And here you try to inject html to non-existant element yet.
    Try to investigate more, hope it helps.

    For a quick check, try first show your dialog and then insert html and see if it’s been inserted.

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

Sidebar

Related Questions

I have the following jQuery script: $(document).ready(function() { $.ajax({ url: 'temp.ajax.php', type: 'GET', success:
I have the following: jQuery.ajax({ type: GET, url: website/Function, data: '&link=' + link, contentType:
I have the following simple jquery snippet $(document).ready(function () { $.ajax({ url:myjson.json, dataType: 'json',
I have the following code: jQuery: $.ajax({ url: '/personcontroller/getperson', cache: false, type: POST, data:
I'm having problems using ajax with jQuery... I have the following jscript: $(document).ready(function() {
I have the following jQuery Ajax call: $.ajax({ type: POST, url: addtobasket.php, data: sid=<?=
i have the following references to jquery on my page: <link href=http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css rel=stylesheet type=text/css/>
I have the following jQuery: $(document).ready(function () { $(.element).draggable(); $(.element).droppable({ drop: function () {
I have the following jquery function > <script type=text/javascript> > > $(document).ready(function() { >
I have the following jQuery ajax call setup: function Testing() { var result =

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.