I have a JQuery function who add a Table in the JSP dynamically:
$('#add').click(function(event) {
event.preventDefault();
$('.tabela_procurador').before
('<table id="tabela_nova' + i + '" class="tabela_nova"> ' +
'<tr> ' +
'<td colspan="4" class="subTitulo_barra"> ' +
'<spring:message code="representante_legal" /> '+ i +' ' +
'</td> ' +
'</tr> ' +
'</table>');
i++
});
});
But when i added this table i lost the spring:message.
There is something i can do to jquery recognize this spring:message?
As a workaround, put the message value in a hidden input on your jsp page. Then get its value in your javascript. In your case:
<c:set var="val"><spring:message code="representante_legal"/></c:set>
<input id="representante_legal" type="hidden" value="${val}"/>
In your javascript (using jquery) you can then use it as follows:
$('#representante_legal').val()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With