Hello!
Made on jquery the so-called counter of clicks on the picture and hits.
Here is the javascript code:
jQuery(document).ready(function($){ $('.click').click(function(){ var id = $('input[name=id]').val() $.get('response.php', {'click':true, 'id':id}); }); $('.hits').load(function(){ var id = $('input[name=id]').val() $.get('response.php', {'hits':true, 'id':id}); }); }); Pictures are displayed as:
<div class="show"> <a href="http://#" class="click" title="summer" target="_blank"> <img src="http://.../logo-girl-summer.png" class="hits" alt="summer"> <input type="hidden" name="id" value="4"> </a> </div> Hidden field I pass the id of the picture.
Well, the whole thing when you click or show is transmitted in response.php and processed there.
Everything works, but I discovered a bug that if 2 pictures on one page, then only TOP ... reacts to clicks and impressions. the hidden field <input type="hidden" name="id" value="4"> transmits the id of the top picture when you click on any of them.
How to make a click on your id?