AJAX输出为HTML表格

Is it possible to have AJAX output to html, rather than plain-text?

I have a file that pulls a class result from an SQL database. The database connection works, and it prints, but rather than printing the table format I desire, it simply prints the table elements as text on the page instead.

public class hw11
{
    int crn;
    String output = "temp";

    public String getOfferings(int crn)
    {
        this.crn = crn;     

        //DB Connection
        String url = "jdbc:odbc:registrar";
        Connection con;
        PreparedStatement stmt;

        String query;
        query = "SELECT * FROM offerings WHERE crn = " + crn +";";

        try
        {
            Class.forName("sun.jdbc.odbc.JdbcOdbcDriver");
        }
        catch(java.lang.ClassNotFoundException e)
        {
            System.err.print("ClassNotFoundException: ");
            System.err.println(e.getMessage());
        }

        try
        {
            con = DriverManager.getConnection(url, "", "");
            stmt = con.prepareStatement(query);
            ResultSet rs = stmt.executeQuery();   

            output = "<table border='1'><tr>";
            output+= "<th>CRN</th><th>Course</th><th>Section</th><th>Dates</th><th>Times</th><th>Instructor</th><th>Room</th><th>Max Enrolled</th><th>Current Enrolled</th></tr>";

            while (rs.next())
            {
                String course = rs.getString("COURSE");
                String section = rs.getString("SECTION");
                String dates = rs.getString("DATES");
                String times = rs.getString("TIMES");
                String instructor = rs.getString("INSTRUCTOR");
                String room = rs.getString("ROOM");
                int enrollmax = rs.getInt("ENROLLMAX");
                int enrollcur = rs.getInt("ENROLLCURRENT");

                output += "<tr>";
                output += "<td>"+crn+"</td><td>";
                output += "<td>"+course+"</td><td>";
                output += "<td>"+section+"</td><td>";
                output += "<td>"+dates+"</td><td>";
                output += "<td>"+times+"</td><td>";
                output += "<td>"+instructor+"</td><td>";
                output += "<td>"+room+"</td><td>";
                output += "<td>"+enrollmax+"</td><td>";
                output += "<td>"+enrollcur+"</td><td>";
                output += "</tr>";
            }

            output += "</table>";

            stmt.close();
            con.close();
        }

        catch (SQLException ex)
        {
            System.err.println("SQLException: " + ex.getMessage());
        }     


        //Output
        return output;
    }

}

HTML Page:

<p>

Get Course Offerings
<br/><br/>

Course CRN: <input type="text" id="theCrn"/>
<input value="Send" type="button" onclick="update()"/>

<br/>Reply:<br/>
<span id="theReply"></span>

</p>

Yes, you can return anything in response to an ajax call.

Just make sure you append it properly to the page.