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 7985707
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:37:55+00:00 2026-06-04T11:37:55+00:00

I have an ajax call within another anonymous function. The problem I am having

  • 0

I have an ajax call within another anonymous function. The problem I am having is that the length of this is zero.

//data_ajax_target equals '#partial_f_Picture'
Debug.Log($(data_ajax_target).length); // equal zero.

This prevents the html returned from the ajax call from replacing the contents of the div.

Here is my div

<div id="#partial_f_Picture">
    <div id="fileuploader-small-f_Picture" 
        data-ajax-uploadurl="...omitted..."
        data-ajax-target="#partial_f_Picture">
    </div>
</div>

This is my reduced javascript

$(function ()
{
    FileUploaderSmallReady();
});

…

function FileUploaderSmallReady()
{
    var uploaderDiv = $('[id^="fileuploader-small"]').each(function ()
    {
        var data_ajax_uploadurl = $(this).attr('data-ajax-uploadurl');
        var data_ajax_target = $(this).attr('data-ajax-target');

        var uploadersmall = new qq.FileUploader({
            element: document.getElementById($(this).attr('id')),
            action: data_ajax_uploadurl,
            onComplete: function (file, response, responseJSON)
            {
                var data_ajax_url = responseJSON['data_ajax_url'];
                if (typeof data_ajax_url != 'undefined')
                {
                    $.ajax(
                        {
                            type: "GET",
                            url: data_ajax_url,
                            beforeSend: AjaxBegin(),
                            success: function (html)
                            {
                                Debug.Log(data_ajax_target);
                                //== #partial_f_Picture

                                Debug.Log($(data_ajax_target).length);
                                //== 0
                                $(data_ajax_target).html(html);
                            }
                        });
                }
            }
        });});} //moved braces up to prevent code from being in a scroll window.
  • 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-04T11:37:56+00:00Added an answer on June 4, 2026 at 11:37 am

    Change <div id="#partial_f_Picture"> to <div id="partial_f_Picture">. The # in the selector means “it’s an id” (as opposed to . which means “it’s a class” and lack-of-prefix which means “it’s a dom tag” (p, div, etc)).

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

Sidebar

Related Questions

Within my index.php file I have an AJAX function that will call a function
I have an ajax call that fires multiple times but is called once. function
A situation I ran across this week: we have a jQuery Ajax call that
The problem is the following. We have lots of ajax call via $.ajax function.
I'm having this problem, where basically, I have a big array, that I break
I have a ajax call on my onkeyup event, that checks if the given
I have a jQuery AJAX call with type:'GET' like this: $.ajax({type:'GET',url:'/createUser',data:userId=12345&userName=test, success:function(data){ alert('successful'); }
I have an $.ajax call that includes both a success and error condition: $('input[name=StateName]').live('change',
I have a simple ajax call: $.ajax({url: my_url_here, dataType: 'text', success: function(data, textStatus) {
I have some JavaScript that is making an Ajax call to a relative url

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.