Home > Technical & Creative Skills > Programming, Servers & Scripts

script for opening affiliate link in a different tab (10)


04-15-2018 08:17 AM #1 whereisthemoney (Member)
script for opening affiliate link in a different tab

Hi guys
I'm looking for a script that will open my affiliate link in a different tab while in my current tab it will redirect the user to another offer (which he will see after he closes the new tab that was opened for him).
Lets say my link looks like this :
<a href="http://www.affiliate-link.com" class="submit button" > click here </a>
What code do I need to add to make it the way I want it to be?

Thanks!


04-15-2018 09:04 AM #2 stickupkid (Senior Moderator)

Just add target = "blank" and the link will be opened in a new tab. Just don't know how to let the original tab show another offer, after the new tab is opened.


04-15-2018 11:24 AM #3 mrbraun (Moderator)

I guess you mean this script:

HTML Code:
<script language="javascript" type="text/javascript">
if (parent.window.opener){ parent.window.opener.location.replace('http://google.com');
}
</script>
But don't use with POP sources. You can be banned


04-15-2018 11:34 AM #4 xechel0nx (Member)

Just:

<a href="http://www.affiliate-link.com" target="_blank" class="submit button" > click here </a>


04-15-2018 03:47 PM #5 williamv (Member)

Here is the solution:

Code:
<a href="http://www.affiliate-link-for-new-tab.com/" target="_blank" onclick="setTimeout(function() { location.href = 'http://www.affiliate-link-for-current-tab.com/'; }, 100)">Click Here</a>


04-15-2018 06:02 PM #6 eurosen (AMC Alumnus)

Do these links not get blocked by chrome?


04-15-2018 06:39 PM #7 williamv (Member)

It's working in Chrome too


04-17-2018 04:45 PM #8 whereisthemoney (Member)

Quote Originally Posted by williamv View Post
It's working in Chrome too
Thanks William! Can you please also give me a good exit block pop? I used to have some good ones in the past but the changes in browsers especially in chrome made my codes useless...thanks in advance!


04-18-2018 01:42 AM #9 Mr Baffoe (Veteran Member)

Hi since you are using Prosper202 you can just use the leave behind feature without writing any scripts.

It will do exactly what you need.


04-18-2018 01:11 PM #10 whereisthemoney (Member)

Thanks Nana!


Home > Technical & Creative Skills > Programming, Servers & Scripts