Viewing 6 replies - 1 through 6 (of 6 total)
  • Hie joloshop,
    window.location.href is used to fetch current URL. You have to assign URL to it, if want to redirect to some other page.
    To redirect to some other page please try script like this :

    <script>
    window.location = "https://www.google.co.in”;
    </script>

    -OR-

    <script>
    window.location.href = "https://www.google.co.in”;
    </script>

    Hope this will solve your purpose.
    Thanks

    Thread Starter joloshop

    (@joloshop)

    Hi thank for your help, i did that. still the link shows but did not open.

    This is my code

    <script type="text/javascript">
    window.setTimeout(function() {
        window.location.href = "<?php echo get_clpr_coupon_url( $post ); ?>";
    }, 2000);
    </script>

    What are you expecting <?php echo get_clpr_coupon_url( $post ); ?> to be?

    At the moment it’s https://gutscheincloud.info/gutscheine/otto-10prozent-rabatt-4, which is the page you linked to. So it gets stuck in a loop.

    Thread Starter joloshop

    (@joloshop)

    sorry i was testing no its supposed to open https://gutscheincloud.info/go/otto-10prozent-rabatt-4/126891 which now shows but is not opening if you reload it opens

    Please use below code.
    It is running absolutely fine.

    <script>
    window.setTimeout(function() {
    window.location.href = "https://www.google.co.in";
    }, 2000);
    </script>

    If this doesn’t work for you, means <?php echo get_clpr_coupon_url( $post ); ?> is creating some problem. Kindly echo that and see is you are getting the value you are expecting or not.

    Thanks

    Thread Starter joloshop

    (@joloshop)

    unfortunately still not working, the link opens but it is not executing…. if i reload the the side it opens…

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘link not opening’ is closed to new replies.