jQuery insidehtml 表
我使用 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您是否尝试过追踪问题?
例如,
这是否显示表数据?
如果是这样,那么 $('#submenu') 就是问题所在。我会首先让它可见并避免所有影响,直到您确定它正在工作。
我希望这有帮助。
Have you tried to trace the problem?
E.g.
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.