Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Nov 2007
    Posts
    4
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Open javascript link in same window

    Hi!

    I'm a complete newbie and I need some help.

    I have this piece of code which is opening link in new window:

    Code:
    <script type="text/javascript">//<![CDATA[
    document.write('<a href="javascript:void window.open(\'<?php echo $product_flypage ?>\');">');
    document.write( '<?php echo ps_product::image_tag( $product_thumb_image, 'class="browseProductImage" target="_self" border="0" title="'.$product_name.'" alt="'.$product_name .'"' ) ?></a>' );
    //]]>
    </script>
    How to change this code so link would open in the same window?
    Probably I should change this part: javascript:void window.open

    Thanks for your help!

  • #2
    New Coder
    Join Date
    Feb 2009
    Posts
    10
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Code:
    <script type="text/javascript">//<![CDATA[
    document.write('<a href="(\'<?php echo $product_flypage ?>\');">');
    document.write( '<?php echo ps_product::image_tag( $product_thumb_image, 'class="browseProductImage" target="_self"); ?></a>' );
    //]]>
    </script>
    This may work, i'm not sure.


  •  

    Tags for this Thread

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •