Support » Plugins » Hacks » How to open derived link in a new window

  • I need some help to perform what I believe is a simple task.

    I have a plugin running that uses a database and url options to determine the final part of a link for a referral program. It is basically an auto rotator.

    I want to open the link automatically in a new window, i.e., execute a “popup” of the target website so the visitor doesn’t HAVE to click on the appropriate link since it will open automatically.

    The plugin (named ‘raleighs’) currently uses the following line to write the target URL on the page:
    <p> ” target=”_blank”><?php _e( ‘Join Now’, ‘raleighs’ ); ?>
    <?php _e( ‘Additional Info:’, ‘raleighs’ ); ?>

    How can I use this same link to make the page open in a new window/tab?


Viewing 1 replies (of 1 total)
  • @raleighs

    It appears as though some of your code was stripped from the comment, but basically the ‘target’ attribute will determine the link’s behavior. If target=”_blank”, then the link will open in a new window or tab, depending on the browser.

    It sounds like you want to go a step further and automatically ‘click’ the link on behalf of the user. The best solution for that would probably be some JavaScript code that would trigger the ‘click’ event on the link.

Viewing 1 replies (of 1 total)
  • The topic ‘How to open derived link in a new window’ is closed to new replies.