insert html received from an ajax call into table cell

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

Open in new window

LVL 34
Big MontySenior Web Developer / CEO of ExchangeTree.org Asked:
Who is Participating?
 
leakim971PluritechnicianCommented:
you need to show more code, there nothing wrong here

http://jsfiddle.net/xz8gt/

//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
http://validator.w3.org/
0
 
Kiran SonawaneProject LeadCommented:
Another possibly is you have DOM (other html) with same id i.e tdGames by mistake in a page.
0
 
Big MontySenior Web Developer / CEO of ExchangeTree.org Author Commented:
had some malformed HTML, I just assumed there was something wrong with the HTML. thx!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.