<script>
var some_val = false;
if (some_val) {
    window.location = "/other.html";
}
</script>
Test Content
<a href="another.html">Some Link</a>