473,385 Members | 1,766 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

capturing and changing the link



Hello

How can I capture the link a user clicks on ? After capturing will I
be able to form the HTTP request so that I can change the server its
going to?

For example...if the URI in the page says www.link1.com/data1, should
the user click on it, I would like this to be send to
server1.link1.com to get the url /data1

Is this possible? If so how

TIA

Coamp
Mar 27 '08 #1
4 1299
SAM
browser newbie a écrit :
>
Hello

How can I capture the link a user clicks on ? After capturing will I
be able to form the HTTP request so that I can change the server its
going to?

For example...if the URI in the page says www.link1.com/data1, should
the user click on it, I would like this to be send to
server1.link1.com to get the url /data1
I do not understand, can't you write dierctly the good code in your links ?
Is this possible? If so how
<a href="http://www.server_one.com/folder/datas.htm"
onclick="var strg1 = 'server_one.com';
var strg2 = 'server_two.org';
this.href = this.href.replace(strg1,strg2);
alert(this.href);
">link</a>

--
sm
Mar 27 '08 #2
SAM wrote on 27 mrt 2008 in comp.lang.javascript:
browser newbie a écrit :
>>
Hello

How can I capture the link a user clicks on ? After capturing will I
be able to form the HTTP request so that I can change the server its
going to?

For example...if the URI in the page says www.link1.com/data1, should
the user click on it, I would like this to be send to
server1.link1.com to get the url /data1

I do not understand, can't you write dierctly the good code in your
links ?

Because the user would not dream to click the link, knowing the real URL.

>Is this possible? If so how

<a href="http://www.server_one.com/folder/datas.htm"
onclick="var strg1 = 'server_one.com';
var strg2 = 'server_two.org';
<a href="http://www.cnn.com/"
......
var strg1 = 'cnn.com';
var strg2 = 'moc.etiSonroPreh'.split('').reverse().join('');
this.href = this.href.replace(strg1,strg2);
alert(this.href);
">link</a>


--
Evertjan.
The Netherlands.
(Please change the x'es to dots in my emailaddress)
Mar 27 '08 #3
SAM
Evertjan. a écrit :
>
var strg2 = 'moc.etiSonroPreh'.split('').reverse().join('');
Rhhoooô !

--
sm
Mar 27 '08 #4
On Wed, 26 Mar 2008 16:58:07 -0700, browser newbie wrote:
Hello

How can I capture the link a user clicks on ? After capturing will I be
able to form the HTTP request so that I can change the server its going
to?

For example...if the URI in the page says www.link1.com/data1, should
the user click on it, I would like this to be send to server1.link1.com
to get the url /data1

Is this possible? If so how
Yes, this is possible as described in a couple of ways in this thread,
but it *is* a bad idea.

*) If the user does not have Javascript enabled, they will not go where
you want them to go.

*) If this is used to "trick" someone to follow a link they do would not
normally follow, you risk offended and making your visitors mad. If
you did this to me, I would not return to your page.

*) It can break search engines.
Mar 27 '08 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Tim Williams | last post by:
----- Original Message ----- From: "Tim Williams" <listserver@tdw.net> > ----- Original Message ----- > From: "Steve Holden" <steve@holdenweb.com> > Yeah, I did wonder about changing the...
15
by: Tony Gahlinger | last post by:
I'm using my browser (Mozilla/5.0 Linux i686 Gecko/20031007 Firebird/0.7) to do some client-side image processing. I want to capture the sequence of coordinates a user clicks on in xxx.jpg in the...
7
by: jerrygarciuh | last post by:
Hello, I have been playing with various Googled solutions for capturing the <Enter> key to suppress form submission. My first question is whether anyone has a script that works in all common...
33
by: Joerg Schuster | last post by:
Hello, Python regular expressions must not have more than 100 capturing groups. The source code responsible for this reads as follows: # XXX: <fl> get rid of this limitation! if...
0
by: John Smith | last post by:
I was hoping to be able to display a link in a status bar each time user drag the mouse over a clickable link. ( you know like IE does in its left side of status bar). What event gets fired and...
14
by: Brent Burkart | last post by:
I am trying to capture the Windows Authenticated username, but I want to be able to capture the login name that exists in IIS, not Windows. In order to enter my company's intranet through the...
2
by: Stampede | last post by:
Hi guys & girls, I would like to write some kind of "Head-Tracking-Software", which uses a WebCam to react to the movement of the head of the person sitting in front of the monitor. I searched...
1
by: satishkatarapu | last post by:
hi i want the code in asp for--- when a client gets a news letter to his mail box if he opens it he gets 2 options i.e, UNSUBSCRIBE and send this link to friend. 1) if that client clicks on...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.