Proprieta85
Programmer
Hi guys can help me are very little versed in javascript ... I explain my problem!
I have a table where they passed the results of a query ...
The table field is called Article and consists of about 500 characters, but the substring in the table with a step the first 40 characters, and now the question arises ... I would click on the text of the article and see the page the entire article ...
query="SELECT * FROM Articolo ORDER BY titolo DESC";
ResultSet r = stmt.executeQuery(query);
%>
<table border="1">
<tr><td> titolo </td> <td> articolo </td> <td> data inser </td></tr>
<%
while(r.next())
{
Tot = r.getString("titolo");
Art = r.getString("articolo");
dat = r.getString("data_inserimento");
String meta = "";
String metadata = "";
meta = Art.substring(0,40);
metadata = dat.substring(0, 10);
StringBuffer sb = new StringBuffer(meta);
sb.replace(37,40, "...");
String s2 = sb.toString();
%>
<tr>
<td> <%= Tot %> </td>
<td> <a href="#" onClick="this.innerText = '<%= Art %>';"><%= s2 %></a> </td>
<td> <%= metadata %> </td>
</tr>
<%
}
%>
</table>