<div id="ad">
<script type="text/javascript">
var zone = "123"
</script>
<script type="text/javascript" src="https://adv.com/script.js"></script>
</div>
<div id="ad">
<script type="text/javascript">
var zone = "123"
</script>
<script type="text/javascript" src="https://adv.com/script.js"></script>
</div>
$(window).on("load", function() {
if ( $("#ad").length ) {
$("#ad").show();
} else {
$("#ad").hide();
}
});