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!)
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?
When you press that button will open 3 different links.
Ovi
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?
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>
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.Originally Posted by crowebird
I understand now.
Ovi
I'm sure my stupid question 3 or 4 posts earlier didn't help much, my bad.Originally Posted by ovi
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks