Link to 2 places?

All about creating websites!
Post Reply
User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
19
Contact:

Link to 2 places?

Post by ayu »

How do i get a link to link someone to 2 places at once? :/

like "somelink" you click it and it opens 2 windows with 2 different sites

User avatar
Gogeta70
^_^
^_^
Posts: 3275
Joined: 25 Jun 2005, 16:00
19

Post by Gogeta70 »

Code: Select all

<a href='www.site1.com' target='_Blank' onclick='window.location("www.site2.com")'>Click here</a>
¯\_(ツ)_/¯ It works on my machine...

User avatar
FrankB
Ph. D. in Sucko'logics
Ph. D. in Sucko'logics
Posts: 315
Joined: 06 Mar 2006, 17:00
18
Location: Belgistahn
Contact:

Post by FrankB »

Easy and simple :

Code: Select all

[a href="http://www.google.com/" onClick="window.open('http://www.google.be/','ctrl','directory=no,status=no,title=no,menu=no,navigation=no,scrolling=no,resize=no,width=400,height=560')"]click[/a]
And funnier : multipopping :
[script type="text/javascript"]
function popUp(url1,url2,url3){
_clipping='directory=no,status=no,title=no,menu=no,navigation=no,scrolling=no,resize=no,width=400,height=560'
window.open(url1,'ctrl',+_clipping)
window.open(url2,'ctrl2',+_clipping)
window.open(url3,'ctrl3',+_clipping)
}
[/script]
[body]
[a href="javascript:popUp('http://images.google.com/','http://grou ... google.com')">click</a]
[/body]

Now if you don't want people to see in the status bar what the function does then

Code: Select all

[a href="#" onclick="popUp('http://images.google.com/','http://groups.google.com','http://video.google.com')"]click[/a]
--
FrankB

User avatar
FrankB
Ph. D. in Sucko'logics
Ph. D. in Sucko'logics
Posts: 315
Joined: 06 Mar 2006, 17:00
18
Location: Belgistahn
Contact:

Post by FrankB »

gogeta70 wrote:

Code: Select all

<a href='www.site1.com' target='_Blank' onclick='window.location("www.site2.com")'>Click here</a>
Oopsie, i think that would be :

Code: Select all

 < ... onclick="window.location='http://site2.com'"
And then yet, it doesn't open both windows.

(sorry, i had a real bad day and i spare no one)

--
FrankB

User avatar
Gogeta70
^_^
^_^
Posts: 3275
Joined: 25 Jun 2005, 16:00
19

Post by Gogeta70 »

Meh, i tried. I don't use javascript much for that reason.
¯\_(ツ)_/¯ It works on my machine...

User avatar
ayu
Staff
Staff
Posts: 8109
Joined: 27 Aug 2005, 16:00
19
Contact:

Post by ayu »

Can't get any of it to work :<

User avatar
bad_brain
Site Owner
Site Owner
Posts: 11638
Joined: 06 Apr 2005, 16:00
19
Location: In your eye floaters.
Contact:

Post by bad_brain »

neo, maybe a popup-blocker? or browser-settings?
Image

User avatar
FrankB
Ph. D. in Sucko'logics
Ph. D. in Sucko'logics
Posts: 315
Joined: 06 Mar 2006, 17:00
18
Location: Belgistahn
Contact:

Post by FrankB »

neo130 wrote:Can't get any of it to work :<
Like the boss said : browser settings, any pop-up blockers running ?
go to http://www.popuptest.com/ and check that out, really cool.

Have you switched all the "[" brackets with a regular html closing/opening entity "< />" ?

Also : to avoid pop-up blockers and browser settings for testing purposes, here a trick : get your page by browsing locally as like file:///C:/Whatever/here/is/html and not via a server.


--
FrankB

Post Reply