留言板

div onclick with parameters

Madasamy P,修改在6 年前。

div onclick with parameters

Junior Member 帖子: 90 加入日期: 16-7-27 最近的帖子
<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,修改在6 年前。

RE: div onclick with parameters

Liferay Legend 帖子: 14919 加入日期: 06-9-2 最近的帖子
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!