How to open derived link in a new window (2 posts)

  1. raleighs
    Posted 2 years ago #

    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?


  2. Micah Wood
    Posted 2 years ago #


    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.

Topic Closed

This topic has been closed to new replies.

About this Topic