 <p>what about checking the referral ? are you using php ?, if yes the you can try using refferal instead, like</p> <pre><code>if($_SERVER[’HTTP_REFERER’]!=''){ echo "&lt;script&gt; $(function(){ $.ajax({ type: 'POST', url: this.href, success: updatePortslide, dataType: 'json', data: 'js=2' }); return false; }); &lt;/script&gt;"; } </code></pre>