0

I am trying to load Jsp Page in Div empProfTable using JqueryAjax. and Ihve done like this, im not whether its a right way or not to do so. Please Help

$.ajax({
    url: "GenerateID.jsp",
    type: 'post',
    success: function(msg) {
        $("#empProfTable").load("${pageContext.request.contextPath}/jsp/admin/AddStaff/addempdetail.jsp?Education=1&empid=" + id);
 }

And here is my jsp page

 <% if(request.getParameter("Education")!=null)
{
 %>
<div id="EduQual" style="margin-top: 50px;" >
<table width="100%" border="0" cellpadding="0" cellspacing="0">
    <tr bgcolor="#7ce9ff">
        <td width="12%"><strong>Empcode</strong></td>
        <td width="10%"><strong>Education</strong></td>

    </tr></table>
<% } %>

Im not getting any error either. Thanks in advance

4

1 回答 1

0

您的代码显示,当对 GenerateID.jsp 的 ajax 调用返回成功时,您正尝试使用 load() 方法加载 div。这是你需要做的吗?但是在 ajax 调用中,您使用的是 POST,但我看不到任何发布到 GenerateID.jsp 页面的变量。如果您只是想加载 empProfTable div 的内容,请首先检查您的站点中是否存在该 url,然后单独执行 load() 调用。供您参考load()ajax()link1

于 2013-08-09T12:21:33.073 回答