jQuery insidehtml 表

发布于 2024-10-07 15:02:38 字数 434 浏览 0 评论 0原文

我使用 AJAX 返回一个由 JSP(使用 Spring MVC)生成的完整表。然而,这似乎不起作用。我一开始尝试只返回一个带有
元素的简单名称列表,并且执行得很好,但它不允许我插入表格,它只是不显示任何内容。

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

这个ajax请求返回给我一个像这里一样的表:http://pastebin.com/7BGFLPH2

有人知道为什么这不起作用以及我应该使用什么吗?

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?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

樱花坊 2024-10-14 15:02:38

您是否尝试过追踪问题?

例如,

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

这是否显示表数据?

如果是这样,那么 $('#submenu') 就是问题所在。我会首先让它可见并避免所有影响,直到您确定它正在工作。

我希望这有帮助。

Have you tried to trace the problem?

E.g.

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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文