insert html received from an ajax call into table cell

Posted on 2011-10-20
Last Modified: 2012-05-12
Greetings Experts,

I'm trying to get some html placed into a table cell that I receive from an ajax call and its not working. I know the html is correct because I put in an alert box and verified it (its a simple select box). Can someone have a look and see what I'm doing wrong?

function updateGamesDDL() {
                type: "POST",
                url: "some url",
                success: function (msg) {
                    $("#tdGames").append(msg);    //the html for tdGames is <td id='tdGames' name='tdGames'>
                error: function (xhr, option, err) {
                    alert("XHR Status: " + xhr.statusText + ", Error - " + err);

Open in new window

Question by:Big Monty
    LVL 81

    Accepted Solution

    you need to show more code, there nothing wrong here

    //the html for tdGames is <td id='tdGames' name='tdGames'>

    you mean :

    //the html for tdGames is <td id='tdGames' name='tdGames'></td>

    try to validate your html, perhaps you miss an end tag and/or the page is malformed
    LVL 17

    Expert Comment

    Another possibly is you have DOM (other html) with same id i.e tdGames by mistake in a page.
    LVL 32

    Author Closing Comment

    by:Big Monty
    had some malformed HTML, I just assumed there was something wrong with the HTML. thx!

    Featured Post

    Do You Know the 4 Main Threat Actor Types?

    Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

    Join & Write a Comment

    Suggested Solutions

    Introduction Knockoutjs (Knockout) is a JavaScript framework (Model View ViewModel or MVVM framework).   The main ideology behind Knockout is to control from JavaScript how a page looks whilst creating an engaging user experience in the least …
    Introduction If you're like most people, you have occasionally made a typographical error when you're entering information into an online form.  And to your consternation, the browser remembers the error, and offers to autocomplete your future entr…
    The viewer will learn how to dynamically set the form action using jQuery.
    The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now