473,597 Members | 2,375 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

History

Dan
Is there a way to obtain the last page visited? I don't want to go to
that page, I just want to be able find out what page they came from,
the url of that page. Is this possible?

Dec 4 '05 #1
20 3615
Dan said the following on 12/3/2005 9:02 PM:
Is there a way to obtain the last page visited? I don't want to go to
that page, I just want to be able find out what page they came from,
the url of that page. Is this possible?


No. And thankfully so. You can try document.referr er but it won't
always tell you what page they came from.

Why do you want to know where I came from?

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 4 '05 #2
Dan wrote on 04 dec 2005 in comp.lang.javas cript:
Is there a way to obtain the last page visited? I don't want to go to
that page, I just want to be able find out what page they came from,
the url of that page. Is this possible?


Sure, if it is from the same domain, you can use serverside code.

No, if it is from an other site and not referred,
the page has no right to know securitywize.

--
Evertjan.
The Netherlands.
(Replace all crosses with dots in my emailaddress)

Dec 4 '05 #3
Randy Webb wrote:
Dan said the following on 12/3/2005 9:02 PM:
Is there a way to obtain the last page visited? I don't want to go to
that page, I just want to be able find out what page they came from,
the url of that page. Is this possible?


No. And thankfully so. You can try document.referr er but it won't
always tell you what page they came from.

Why do you want to know where I came from?


Found this:
(http://www.samspublishing.com/librar...urs&seqNum=100)

////// COPY & PASTE :

The history object is another child (property) of the window object. This
object holds information about the URLs that have been visited before and
after the current one, and it includes methods to go to previous or next
locations.

The history object has one property you can access:

* history.length keeps track of the length of the history list—in other
words, the number of different locations that the user has visited.

Note

The history object has current, previous, and next properties that
store URLs of documents in the history list. However, for security reasons,
these objects are not normally accessible in today's browsers.

The history object has three methods you can use to move through the history
list:

* history.go() opens a URL from the history list. To use this method,
specify a positive or negative number in parentheses. For example,
history.go(-2) is equivalent to pressing the Back button twice.
* history.back()l oads the previous URL in the history list—equivale nt to
pressing the Back button.
* history.forward ()loads the next URL in the history list, if available.
This is equivalent to pressing the Forward button.

//// END PASTE
--
Etienne Marais
Cosmic Link
South Africa

Dec 4 '05 #4
Etienne Marais said the following on 12/4/2005 5:36 AM:
Randy Webb wrote:

Dan said the following on 12/3/2005 9:02 PM:
Is there a way to obtain the last page visited? I don't want to go to
that page, I just want to be able find out what page they came from,
the url of that page. Is this possible?

No. And thankfully so. You can try document.referr er but it won't
always tell you what page they came from.

Why do you want to know where I came from?

Found this:
(http://www.samspublishing.com/librar...urs&seqNum=100)


Forget you found it.
////// COPY & PASTE :

The history object is another child (property) of the window object. This
object holds information about the URLs that have been visited before and
after the current one, and it includes methods to go to previous or next
locations.
But it does not tell you where you are in that list.
The history object has one property you can access:

* history.length keeps track of the length of the history list—in other
words, the number of different locations that the user has visited.
But it will not tell you if the page has previous or next entries. Only
how many are in that list.
Note

The history object has current, previous, and next properties that
store URLs of documents in the history list. However, for security reasons,
these objects are not normally accessible in today's browsers.
Pay close attention to the above as it says exactly what I said.
The history object has three methods you can use to move through the history
list:

* history.go() opens a URL from the history list. To use this method,
specify a positive or negative number in parentheses. For example,
history.go(-2) is equivalent to pressing the Back button twice.
Only if there are 2 pages to go back to. And you have no way of
detecting that using script.
* history.back()l oads the previous URL in the history list—equivalent to
pressing the Back button.
Only if there is a page to go back to.
* history.forward ()loads the next URL in the history list, if available.
This is equivalent to pressing the Forward button.


Finally, it says they work "if available". Again, forget you found that
site and find a better one.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 4 '05 #5
Drop your bloody attitude,
I know exactly what has
been said on this thread
and have read my own posting
in detail.

I posted this for informational
purposes, what the f*cking hell
is it with all this fighting and
delusional sense of mastery of
subject.

I was not countering your statements,
merely adding what in what I considered
to be an objective manner.

Bugger off Randy

Randy Webb wrote:
Forget you found it.
But it does not tell you where you are in that list.
But it will not tell you if the page has previous or next entries. Only
how many are in that list.
Pay close attention to the above as it says exactly what I said.
Only if there are 2 pages to go back to. And you have no way of
detecting that using script.
Only if there is a page to go back to.
Finally, it says they work "if available". Again, forget you found that
site and find a better one.

--
Etienne Marais
Cosmic Link
South Africa

Dec 6 '05 #6
Etienne Marais said the following on 12/6/2005 1:02 AM:
Drop your bloody attitude,
I know exactly what has
been said on this thread
and have read my own posting
in detail.
Me? Attitude? Welcome to Usenet.
I posted this for informational
purposes, what the f*cking hell
is it with all this fighting and
delusional sense of mastery of
subject.
It has nothing to do with "mastery" of anything. It has to do with what
this group is about - discussion. If you don't want your
thoughts/contributions discussed then you need to find a new medium to
post your thoughts.

As for "informatio nal" purposes, if it is informationally incorrect
(which that article is) then it is open to be rebuffed, which it was.
I was not countering your statements,
merely adding what in what I considered
to be an objective manner.
And it turns out that your reference was next to useless, incorrect, and
had nothing of value in it.
Bugger off Randy


Now, you bugger off.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Answer:It destroys the order of the conversation
Question: Why?
Answer: Top-Posting.
Question: Whats the most annoying thing on Usenet?
Dec 6 '05 #7
> And it turns out that your reference was next to useless, incorrect, and
had nothing of value in it.


What about it was incorrect ?
--
Etienne Marais
Cosmic Link
South Africa

Dec 6 '05 #8
Etienne Marais said the following on 12/6/2005 7:22 AM:
And it turns out that your reference was next to useless, incorrect, and
had nothing of value in it.

What about it was incorrect ?


Did you read my first reply to your post with the URL? The one where you
copy/pasted from the site and I replied to it, nearly line by line,
telling what was wrong with it and how it didn't help the OP? There is a
lot wrong with the information on that site.

--
Randy
comp.lang.javas cript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Dec 6 '05 #9
VK
Dan wrote:
Is there a way to obtain the last page visited? I don't want to go to
that page, I just want to be able find out what page they came from,
the url of that page. Is this possible?


1) If user came to the current page by clicking a link on the previous
page (not choosing a bookmark or typing in the address bar!)

2) If the previus and the current page are in the same security
protocol (http / http or https / https)

3) If a particular server re-transmits REFERRER header (most do but
there are exceptions).

4) If a particular browser doesn't lock reading document.referr er
property (I don't know of any though)

if ((typeof document.referr er == 'string')
&&(document.ref errer != "")
&&(document.ref errer != document.locati on.href)) {
// I am lucky!
var prevURL = document.referr er;
}

Dec 7 '05 #10

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

Similar topics

15
7375
by: Ashot | last post by:
This is sort of both Python and Vim related (which is why I've posted to both newsgroups). Python related: ---------------------- I have been frustrated for quite some time with a lack of a history command in IDLE (in fact with IDLE in general). Often I'll develop new code at the command line, testing each line as I go. Currently I have to copy and paste, removing outputs and the ">>>" at each line. Is it perhaps possible to make...
12
3357
by: |-|erc | last post by:
when a user clicks back to get to my site, I want it to run a javascript function. can you detect when the FORWARD button is greyed out? Herc -- I call3d this fugly and I'm proud www.supernerd.com.au/~gray77/kath1.jpg
10
8056
by: pmelanso | last post by:
Hello, How can I tell if there is a page to go back to in the history or not??? Same with forward??? say something like/// if (there is a page to go back to ) { // DO something }else { }
3
10464
by: Phil Sherman | last post by:
UDB LUW (Windows) 8.1 FP9a I issued a PRUNE HISTORY 20050819 AND DELETE and was surprised to see that the archived log files were not physically deleted. The history record of the 20050818 backup was correctly deleted from the history file. I then issued a PRUNE LOGFILE PRIOR TO Snnnnnnn.LOG command which did delete the logs. Both commands completed with no errors. LOGRETAIN parameter is set to RECOVERY. What does the 'AND DELETE'...
3
3862
by: pentisia | last post by:
Hi there, We are using history.go(integer) to go back to the certain page directly. Because there are some pages interaction in between. For example, starting from page 1 to page 2. From page 2, it will reload sometime, or go to page 3 and then go back to page 2 again. If we use history.back, it will only go back to the previous page. So, we have to use history.go in order to go back to page 1 correctly. But there is some problem...
3
2237
by: Niall | last post by:
When I say 'last', I mean (eg.) the 100th item in a 100-item history list, *not* the immediately previous one! The problem is, the history.go() method only allows *relative* movement through the history list. I need to go directly to the end -- an *absolute* movement -- and there doesn't appear to be any way of finding out the number of 'steps' that would require. Ideally, what I would use would be something of the form:
10
10408
Ajm113
by: Ajm113 | last post by:
Making a History Page for BIG Sites Intro: Ok, let's say after a while your website has grown massive. We're talking search engine, forum and video hosting -- you've got a LOT of content. And you are wondering, "Why do I need yet another feature for my big site?" Well, some people can become forgetful every time they see content on your site, and let's suppose that one day they needed to work on a good php script for their class and they...
0
1533
by: lemnitzer | last post by:
Full Article: http://iamthewitness.com/FreedmanFactsAreFacts.html <-------- KEY DOCUMENT Steamy Excerpts: Will you be patient with me while I review here as briefly as I can the history of that political emergence and disappearance of a nation from the pages of history?
2
3310
by: Max | last post by:
I recently moved to ASPnet Ext 3.5 What I can't get with Ajax and History browser managemet is this: User fills some fields (dropdown and textbox) on page 1 (all are in an update panel) User clicks Submit Button I write the data into a DB I add a history point with ScriptManager to be able to get back to this point with browser back button Page 2 is loaded with a response.redirect() command
0
7959
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
7883
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8021
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
6677
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
5421
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
3917
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2393
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1492
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1226
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.