简体   繁体   中英

jQuery innerhtml Table

I'm using AJAX to return me a complete table that has been generated by a JSP (using Spring MVC). However, this doesn't seem to work. I tried at first just returning a simple list of names with
elements and this executed fine, but it won't let me insert the table, it just doesn't display anything.

function displaySubMenu(niveauId){
    $.get("submenu.htm",{ niveau : niveauId },function(data){
        $('#submenu').html(data);
        $('#submenu').slideDown('slow');
    });
}

This ajax request returns me a table like the one here :http://pastebin.com/7BGFLPH2

Anyone got an idea why this doesn't work and what I should use?

Have you tried to trace the problem?

Eg

function displaySubMenu(niveauId){
    $.get("submenu.htm",{ niveau : niveauId },function(data){
        alert(data);
    });
} 

Does this display the table data?

If so, then $('#submenu') is the problem. I would start by making it visible and avoid all effects until you're sure it's working.

I hope this helps.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM