0

I fetched some data from database, including the id of each row, and now I'm creating some elements, the ID's of these elements must contain the ID fetched from the Database.

<%
    //Database Codes...I got the rset...
    while (rset.next()) {
%>
<div id="<%=rset.getString(1)%>" class="messageContainer">
</div>
<%
    }
%>

I'm getting the following error

Bad value " " for attribute "id" on element "div":An ID must not contain whitespace.
Syntax of id:
An ID consists of at least one character but must not contain whitespace
4

1 回答 1

1

ID 需要进行 URL 编码。

于 2012-08-20T05:33:32.130 回答