Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

redirect from a link 1

Status
Not open for further replies.

nego78

Programmer
Joined
Jun 13, 2004
Messages
129
Location
PL
Hi

In this code after click, it should redirect here but it moves me
is this possible to halt the original adres
Code:
<a href="[URL unfurl="true"]http://addressforgoogle.pl"[/URL] onclick="window.location='[URL unfurl="true"]http://processaddress';">some[/URL] text</a>

Webdesign
 
why do you have a url in the href then?

do this:

Code:
<a href="[URL unfurl="true"]http://addressforgoogle.pl"[/URL] onclick="window.location='[URL unfurl="true"]http://processaddress';[/URL] return false;">some text</a>

*cLFlaVA
----------------------------
[tt]a frickin' twelve-gauge, what do you think?[/tt]
[URL unfurl="true"]http://www.coryarthus.com/[/url]
 
> why do you have a url in the href then?

i'm writing a web catalog and i don't want to make many outgoing links
every link will be indirect but some "sponsored" will be like this, in javascript i'll write code to add score for clicked pages

Webdesign
 
nego78, expanding on what cory has posted, you can also put javascript in the href so that the inherent property of the anchor link does not activate, like this:
Code:
<a href='javascript:void()' onclick='window.location="[URL unfurl="true"]http://www.google.com"'>google</a>[/URL]

This way when the user hovers over the link they will not see the remote address in the status bar, but are taken to another address upon clicking the link. It may save some confusion for your users.

-kaht

Do the chickens have large talons?
 
kaht:

but this will destroy my idea to show right link to bots and people without javascript

Webdesign
 
but this will destroy my idea to show right link to bots and people without javascript

Perhaps I'm not understanding something. When you hover over the link it will show , but when you click the link it will direct you to . How exactly is that showing the right link? It seems like it would be very misleading to me. Oh well, it seems you have got your issue resolved, so let's just leave it at that.

-kaht

Do the chickens have large talons?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top