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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T05:02:33+00:00 2026-05-12T05:02:33+00:00

I am attempting to use AJAX in jQuery to load content to a div,

  • 0

I am attempting to use AJAX in jQuery to load content to a div, however, it is severely failing:

Here’s the javascript:

$(document).ready(function() {
  $('#webdev').hide();
     $("#apply-webdev").click(function() {
        var form = $("#webdev");
        var formContent = form.find("#webdev");
        form.slideToggle();
        $.ajax({
            url: "api.php?do=get_form_webdev",
            cache: false,
            success: function(data) {
                form.html(data.params);
        },
        dataType: "json"
      });
  });
});

And here’s the HTML:

<div class="rbutton"><button title="Apply for position" id="apply-webdev" onclick="load_webdev_form()">&nbsp;Apply&nbsp;</button></div>
    <div id="webdev">
    <fieldset><legend>Apply for position</legend><div style='padding:10px; text-align:center'><img src='/images/load.gif'/></div></fieldset>
    </div>

What am I doing wrong?

EDIT

Below is the new code, based on answers given in this thread:

$(document).ready(function() {
    $('#webdev').hide();
    $("#apply-webdev").click(function() {
        $("#webdev").slideToggle();
        $("#webdev").load("api.php?do=get_form_webdev");
    });
    $('#webdevcancel').click(function()
        {
            $('#webdev').hide('slow');
        }
    );
    $('#webdevsave').click(function()
        {
        $('#webdev').block({ 
        message: '<h1>Processing...</h1><img src="/images/load.gif" /><br /><br />', 
        css: { border: '3px solid #a00' } 
    });
        }
    );
});
  • 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-05-12T05:02:33+00:00Added an answer on May 12, 2026 at 5:02 am

    The easier way to load content into an element in jQuery is the load method:

    $("#webdev").load("api.php?do=get_form_webdev");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm attempting to use jQuery's $.ajax() function to post form variables to an MVC
I am attempting to use jQuery easing function easeInBounce and I see this error:
I am attempting to use the jQuery $.ajax call to return xml from a
I noticed something when I was attempting to use remoteField ajax tag in grails.
I am attempting to use Greasemonkey and jQuery 1.4.2. When I install the Greasemonkey
I am attempting to create a jQuery plugin for my own use that can
I'm attempting to use the jQuery UI Tabs module, but whenever I attempt to
I'm making a cross-domain AJAX request using jQuery but my callback function is not
Scratching my head on this one. With jQuery tabs I am attempting to use
I am attempting to use the Jquery file upload addon to asynchronously upload files

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.