129
rated 0 times
[
135]
[
6]
/ answers: 1 / hits: 6771
/ 6 Years ago, mon, february 5, 2018, 12:00:00
I have function
$('body').on('click', '.urlsend', function ()
{
console.log(this.parameter);
}
and all elements with .urlsend have some parameter, which I need to pass to the function.
HTML looks like this:
<div id=canvas>
</div>
<script src=https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js></script>
<script type=text/javascript>
function loadImgs(){
<!--somecode-->
function gotData(arr){
var element=;
for(var i = 0;i<arr.data.length;i++)
{
var img = arr.data[i].images.original.url;
element += '<img src='+img+' class=urlsend data-url='+img+'>';
}
$('#canvas').html(element);
}
}
</script>
More From » jquery