The Most Active and Friendliest
Affiliate Marketing Community Online!

“Adavice”/  “CPA

Open different URL from 1 button

O

ovi

Guest
One day searching trough the internet for some information, I have found that is possible to open more URL from 1 button. this can be done using the following code:

Code:
<html>
<head>
   <title></title>
</head>
<script language="javascript">
function whackOpen(){
 var url    =  new Array(3);
 url[0]   = 'http://www.site1.com'
 url[1]   = 'http://www.site2.com'
 url[2]   = 'http://www.site3.com'
 
 for (var i = 0; i < url.length; i++){
    window.open(url[i],"","");
 }
 alert("I am so sorry for creaming your bandwidth")
}
</script>
<body>
<input type="button" onclick="whackOpen()" value="Open windows" />
</body>
</html>
 
A useful bit of code, Ovi, but I can only think that this code is only of use for window bombing the user like p0rn or warez sites (so I've been told - heh!)
 
I actually don't understand this. Does it mean that the button has predefined list of links that it chooses from and then cycles through them?
 
oh, duh, I guess I should have looked at the code a little, sorry.

How is it that some sites are able to open random url's with the same link?
 
Hello

Look at the code, it's so simple...
When you press the submit button, will open 3 sites that are indicated in the code as:
url[0] = 'http://www.site1.com'
url[1] = 'http://www.site2.com'
url[2] = 'http://www.site3.com'

Ovi
 
in that code he used array so all the links in the array will open

if instead you used

<html>
<head>
<title></title>
</head>
<script language="javascript">
function whackOpen(){
myRandNumber = Math.floor(Math.random()*3); /3 for 3 links
if (myRandNumber==0) {
myUrl = 'http://www.site1.com'
}
if (myRandNumber==2) {
myUrl = 'http://www.site2.com'
}
if (myRandNumber==3) {
myUrl = 'http://www.site3.com'
}

window.open(myUrl ,"","");

</script>
<body>
<input type="button" onclick="whackOpen()" value="Open windows" />
</body>
</html>
 
crowebird said:
in that code he used array so all the links in the array will open

if instead you used

<html>
<head>
<title></title>
</head>
<script language="javascript">
function whackOpen(){
myRandNumber = Math.floor(Math.random()*3); /3 for 3 links
if (myRandNumber==0) {
myUrl = 'http://www.site1.com'
}
if (myRandNumber==2) {
myUrl = 'http://www.site2.com'
}
if (myRandNumber==3) {
myUrl = 'http://www.site3.com'
}

window.open(myUrl ,"","");

</script>
<body>
<input type="button" onclick="whackOpen()" value="Open windows" />
</body>
</html>

This is what I was talking about Ovi, I understand that the code you posted opens up 3 windows, I was asking how one link can open up one page then be clicked again and open up an entirely new page with the same link. I wasn't referring to opening multiple pages at the same time.
 
What is a good way to use this code, a way that is useful rather then annoying? I can only think of ways it could be used to spam and annoy people.
 
Am I dillusional, or did we never figure out how to use the same link to open up a new window with random subject matter everytime?
 
They use this a lot on pr0n sites (a guy I know told me ;) ).

Essentially you have a button or text link that says "Click here" and it opens up a new page, or in the same window, content A. You click that same link again, and now you have Content B. I've seen sites have up to 10 different pages or more, based off of one link. If you do this over the course of a page with say 100 links, you can conceivably link to 1000 other pages.
 
Oh I see, ya I wouldn't know because I've never been to one of those sites. :shock:
 
MI
Back