javascript - JS load image on click only -
i need function in js load image on click only. use api , if load captcha image every page load after few requests bans me because not visitors enter captcha.
o have http://site.tld/?captcha_image=3382894 wich if load every time page loads got banned flood.
so need when visitor uses api let's appears text "click here enter captcha", when clicks image loaded.
i don't know js @ all, appreciate help... thanks!
$("button").click(function () { var imgurl = $(this).data('rel'); $("#area").html("<img src='" + imgurl + "' alt='description' />"); });
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script> <button data-rel="http://www.lemis.com/grog/photos/20110726/big/capcha.gif">click</button> <div id="area"></div>
reference link
Comments
Post a Comment