Foros de discusión

div onclick with parameters

Madasamy P, modificado hace 6 años.

div onclick with parameters

Junior Member Mensajes: 90 Fecha de incorporación: 27/07/16 Mensajes recientes
<tbody id="issues1"></tbody>

<script>
var preview = dataList.previewURL;
$("#issues1").append('<tr><td style="padding-left:0px;"><div style="height: 25px;width: 25px;border:1px solid #A9A791;background: url('+dataList.previewURL+')no-repeat;background-size:100% 100%;" onclick="PreviewImage('+preview+');"></div></td><td>'+dataList.artName+'</td><td>'+problem.substring(3)+'</td></tr>');


function PreviewImage(url){
alert(url);
}
</script>


The preview variable not passed to the PreviewImage function
But I don't pass the parameter to function e=when clciking the div the alert works
thumbnail
David H Nebinger, modificado hace 6 años.

RE: div onclick with parameters

Liferay Legend Mensajes: 14919 Fecha de incorporación: 2/09/06 Mensajes recientes
Madasamy P:
The preview variable not passed to the PreviewImage function
But I don't pass the parameter to function e=when clciking the div the alert works




This isn't really a Liferay issue.

Perhaps there's an introductory HTML forum out there you could post to?







Come meet me at the 2017 LSNA!