Go Back   Webmaster Forums UK SEO SEM Webmaster Community Forum - UKWW > General > General Webmaster Talk
Register FAQ Members List Downloads Calendar Today's Posts Webmaster Resources Webmaster Blogs
 
 

General Webmaster Talk General webmaster discussion forums - In this forum and its sub forums you can discuss general webmaster related issues or even issues that does not related to Webmastering.
Sub Forums: Running a forum :: Blogs and Blogging :: Word Press Forums :: Digital Photography

Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 04-21-2005, 08:37 PM
ovi
Guest
 
Posts: n/a
Exclamation Open different URL from 1 button

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>
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #2 (permalink)  
Old 04-23-2005, 06:26 PM
mcfox
Guest
 
Posts: n/a
Default

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!)
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #3 (permalink)  
Old 04-24-2005, 01:57 AM
Duke
Guest
 
Posts: n/a
Default

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?
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #4 (permalink)  
Old 04-24-2005, 09:24 AM
ovi
Guest
 
Posts: n/a
Default Hello

When you press that button will open 3 different links.

Ovi
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #5 (permalink)  
Old 04-24-2005, 09:26 AM
Duke
Guest
 
Posts: n/a
Default

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?
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #6 (permalink)  
Old 04-24-2005, 09:46 AM
ovi
Guest
 
Posts: n/a
Default 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
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #7 (permalink)  
Old 04-24-2005, 02:21 PM
Senior Member
0 posts this year. needs some grease!
New user, who has not interacted much yet.
 
Join Date: Aug 2004
Posts: 328
Thanks: 0
Thanked 0 Times in 0 Posts
Nominated 0 Times in 0 Posts
TOTW/F/M Award(s): 0
Default

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>
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #8 (permalink)  
Old 04-24-2005, 06:02 PM
Duke
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by crowebird
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.
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #9 (permalink)  
Old 04-24-2005, 06:06 PM
ovi
Guest
 
Posts: n/a
Default :)

I understand now.

Ovi
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
  #10 (permalink)  
Old 04-24-2005, 10:40 PM
Duke
Guest
 
Posts: n/a
Default

Quote:
Originally Posted by ovi
I understand now.

Ovi
I'm sure my stupid question 3 or 4 posts earlier didn't help much, my bad.
Digg this Post!Add Post to del.icio.usStumble this Post!Wong this Post!
Reply With Quote
Reply

Bookmarks



Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Webmaster Resources
UK WW SEO Tools
Find UK Hosts
 
The Forum Rules
Forum Rules - MUST READ
 
Site Of the Month
BizzFace
Nominate site of the month
 
Tag Cloud
43. wholesale adsense ready apple iphone 16gb apple iphone 16gb 3g articles article writer australia web hosting beauty cash casino cheap clothes communications content custard media database dgital camerals domain name english teacher fantasy football fantasy football league fittness football league free handbags home income instant jewelry links link sale medical health money money making online music natural health news nokia n96 16gb one way links online online shop poker professor quality links replica sam allcock seo social networking sony vaio laptop sunglasses technology the medical plus themes tutor verbalized wallet wallets wanted web hosting widget ready wordpress xmas offer

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Open Sources, Open Notebook: Why Oracle Should Worry rakib General Webmaster Talk 0 07-21-2007 07:03 AM
They pressed the PR update button Bagi Zoltán Google 16 04-28-2007 02:50 PM
UK WW Google Toolbar button melkior_inactive General Webmaster Talk 3 03-21-2007 09:41 AM
Choose button GIVES php code lim038 iG Shop 0 04-25-2004 10:56 AM
The button CHOOSE in admin section Opan'ka iG Shop 1 04-25-2004 10:54 AM


All times are GMT. The time now is 08:09 PM.

UK Webmaster World Forums - Internet marketing, web development, domain names, SEO contest and discussuons.
Subscribe to our feeds   Subscribe to our feeds

Powered by vBulletin® Version 3.7.0
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0