Foren

div onclick with parameters

Madasamy P, geändert vor 6 Jahren.

div onclick with parameters

Junior Member Beiträge: 90 Beitrittsdatum: 27.07.16 Neueste Beiträge
<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, geändert vor 6 Jahren.

RE: div onclick with parameters

Liferay Legend Beiträge: 14916 Beitrittsdatum: 02.09.06 Neueste Beiträge
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!