473,507 Members | 2,395 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

capture a URL

2 New Member
I'm putting together a feedback form, and would like to 'capture' the URL of the previous page as part of the feedback. Can anybody help me with this?
Jan 31 '08 #1
5 1565
harshmaul
490 Recognized Expert Contributor
Hi,
There is a javascript object that will do that for you...

you can try

Expand|Select|Wrap|Line Numbers
  1. <script type="text/javascript">
  2. <!--
  3. if (document.referrer&&document.referrer!="")
  4.   document.write(document.referrer);
  5. -->
  6. </script>
Didn't have time to test it exactly but you can just google that object and thats what you need.
Jan 31 '08 #2
RedMorgan
2 New Member
Thanks Harsh, I give it a try
Feb 1 '08 #3
gits
5,390 Recognized Expert Moderator Expert
hi ...

you should avoid document write when the page is loaded since it 'destroys' the document ... you could fill a hidden field onload of the form-page with the referrers value:

Expand|Select|Wrap|Line Numbers
  1. function init_fields() {
  2.     var n = document.getElementById('my_ref_hidden_field');
  3.     n.value = document.referrer;
  4. }
and call that function onload of you document:

[HTML]<body onload="init_fields();">[/HTML]
it assumes that you have a hidden input-field with an id called 'my_ref_hidden_field' ...

kind regards
Feb 1 '08 #4
harshmaul
490 Recognized Expert Contributor
Hi again,
I agree with gits, don't document write it out. i only document wrote it to show you where the variable was stored in the DOM.
Feb 1 '08 #5
gits
5,390 Recognized Expert Moderator Expert
Hi again,
I agree with gits, don't document write it out. i only document wrote it to show you where the variable was stored in the DOM.
hi ...

i know ... just wanted to point it out to avoid those document.write() 'errors' in case the OP wouldn't be aware of it ... you gave the correct hint regarding the referrer that basicly is the thing the OP was looking for :)

kind regards
Feb 1 '08 #6

Sign in to post your reply or Sign up for a free account.

Similar topics

0
1480
by: Mark Barinstein | last post by:
Hello. W2K, db2 v7, FP10a. Before now our replication worked properly. But some days ago capture suddenly stopped loggin and filling cd tables without any messages. The last message was like...
2
5963
by: Jose | last post by:
There's something for me to learn with this example, i'm sure :) Given this text: "....." and my first attempt at capture the groups: "(?:\)" RegExTest gives me what i expect: 6 captured...
0
2677
by: Tsunami | last post by:
Hi to all: I have a big problem and I write to ask for help. Sorry if this message does not arrive to the apropriate group. I have selected them paying attention but I am not sure to do it well....
4
3358
by: jxiang | last post by:
I created a child form that is much bigger than the MDI form in VB.Net. I am trying to capture the whole child form and save as an image or sent to printer. I tried to use BitBlt to capture the...
2
2401
by: py | last post by:
I need to take a screen shot of the computer screen. I am trying to use PIL and I saw there is ImageGrab...however it only works on Windows. Is there a platform-independent ability to work...
4
5353
by: gwhite1 | last post by:
I use this code to capture a screen in a regular VB 2005 windows app. It works great! I found the code in google. But when I create a windows service it does not capture the screen. It only...
0
1813
by: Roger | last post by:
I am in the process of installing DB2 Replication V 8.2 for Z/os on my test system. When I start the ASNSTRC (capture) with RRS shutdown, it switches to CAF and starts up. However, if I have RRS...
0
3466
by: j101 | last post by:
I am attempting to set up Q Capture on RH Linux (x86_64) using DB2 9 fp2, but there seems to be a general problem loading a specify MQ shared library "/opt/mqm/lib/libmqm_r.so". I have MQ v6...
2
7313
by: pampululu | last post by:
hello, I try to use directx.capture in my web application, I use visual studio web developper 2005 express with c# for code behind. I can list the webcam available on computer, no probem, my...
1
3351
by: sangith | last post by:
Hi, I tried the packet capture module program. I did a file transfer using ftp from this host to another server. But when I ran the program, it was just hanging off and it did not print the...
0
7223
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
7111
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
7319
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,...
0
7485
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...
0
5623
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,...
1
5042
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
760
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
412
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...

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.