473,804 Members | 3,478 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.c om to get the url /data1

Is this possible? If so how

TIA

Coamp
Mar 27 '08 #1
4 1315
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.c om 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.repla ce(strg1,strg2) ;
alert(this.href );
">link</a>

--
sm
Mar 27 '08 #2
SAM wrote on 27 mrt 2008 in comp.lang.javas cript:
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.etiSonroPr eh'.split('').r everse().join(' ');
this.href = this.href.repla ce(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.etiSonroPr eh'.split('').r everse().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.c om
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
3193
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 code (though it's not my first > choice. I've done it before and caught a crab later), or could I do it > with Subclassing? >
15
7062
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 following html <a href="#"><IMG SRC="xxx.jpg" ISMAP></a> and save these to a file for later handling. The coordinates appear on the bottom left of the window as I move the mouse, so I know they're being passed around somehow, but I haven't...
7
20377
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 browsers? The script bellow is IE only. It fails FF 1.0 and NN 7. Also, if I can trap the keypress I would like to use it to tab to the next tabindex.
33
5655
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 p.pattern.groups > 100: raise AssertionError( "sorry, but this version only supports 100 named groups"
0
1095
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 how can I get the link, please ? so I will able to display. Thanks in advance
14
2554
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 internet, they have to login. I want to be able to capture that login versus their Windows login because I need to know who they are from any computer rather than only their computer. Any ideas? Thanks
2
2701
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 the web and found some information on writing such a software with the help of the DirectShow library of DirectX9. But as it was all in C++ and as I'm not very good in C++ I thought someone here might give me a link or some other information on how...
1
1085
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 that UNSUBSCRIBE he has to be unsubscribed and his email should be captured in the data base(sql server) which we are using. 2) and the link sent to his friend, if he clicks on the link, the subscription form will be opened. But the moment he...
0
10593
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10329
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10085
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9163
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6858
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5527
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5663
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3830
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3000
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.