Fórum

div onclick with parameters

Madasamy P, modificado 6 Anos atrás.

div onclick with parameters

Junior Member Postagens: 90 Data de Entrada: 27/07/16 Postagens Recentes
<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 6 Anos atrás.

RE: div onclick with parameters

Liferay Legend Postagens: 14916 Data de Entrada: 02/09/06 Postagens Recentes
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!