<script> function GetCurrentJumpUrl(){ var eleLink = document.getElementById('adLink'); if(eleLink){ var url = eleLink.getAttribute('href'); //alert(url); window.external.OpenNewUrlInChrome(url); return false; } return false; } </script>
<div class="main-box"> <div class="cont"> <!-- 这一段HTML是需要广告那边修改,加上id,加上 onclick事件 --> <a id="adLink" href="https://xxx.html" target="_blank"> <img src="https://xxx.jpg" alt="xxx" onclick="javascript: return GetCurrentJumpUrl();"></a> </div> </div>