I want to use history.go() to navigate between my previously loaded pages.
I'm looking for a way to trigger a function call when a page is accessed
using history.go(). Is there an event generated?
Is there a method for detecting what page the user came from when a page
is accessed using history.go()?
--
Ed Jay (remove M to respond by email) 8 2650
Ed Jay said the following on 1/1/2006 9:29 PM: I want to use history.go() to navigate between my previously loaded pages. I'm looking for a way to trigger a function call when a page is accessed using history.go(). Is there an event generated?
Just the normal events. But you can't tell how it was triggered.
Meaning, when page1.html is accessed, it has no means of knowing whether
it was loaded with the back button, the history.go or a direct link.
Is there a method for detecting what page the user came from when a page is accessed using history.go()?
No.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
Randy Webb <Hi************@aol.com> wrote: Ed Jay said the following on 1/1/2006 9:29 PM: I want to use history.go() to navigate between my previously loaded pages. I'm looking for a way to trigger a function call when a page is accessed using history.go(). Is there an event generated? Just the normal events.
For example?
But you can't tell how it was triggered. Meaning, when page1.html is accessed, it has no means of knowing whether it was loaded with the back button, the history.go or a direct link.
That's not a problem for my application. Is there a method for detecting what page the user came from when a page is accessed using history.go()?
No.
I'm trying to write an editing routine for a multiple-page application.
Simple example:
Say I have three pages. The first two are 'data entry' pages and Page 3 is
a reporting page. I enter data in a form on Page 1 and submit it via CGI
to a script. On submitting the form, I set a flag on Page 1. The [Perl]
script reads the form from Page 1 and generates Page 2 in which more data
is entered in a form. This form is submitted, along with the data from
Page 1 (in hidden input elements), to Page 3.
From Page 3, if I want to edit something on Page 1, I use history.go(-2)
to navigate to Page 1 where I edit the data. On re-submitting Page 1, I
check to see if my flag is set. If it is, I go directly to Page 3. Of
course, when I reload Page 3 with the edited data from Page 1, I lose the
data previously entered on Page 2. Short of saving the data from Page 2 to
a file or in a cookie, I haven't been able to think of a way to reload
Page 3 without losing the data.
My path to a solution brings me to using history.go(2) on Page 1 to get to
Page 3 with its Page 2 data still intact, but how to update Page 3 with
the new Page 1 data? I can envision ways to bring the data to Page 3, but
I need something to let me know when Page 3 is available to receive the
edited data. I tried using onLoad() to call a script, but fetching the
page from the browser history didn't work. There doesn't seem to be an
onLoad event.
What's this poor newbie to do?
--
Ed Jay (remove M to respond by email)
"Randy Webb" wrote Ed Jay said I want to use history.go() to navigate between my previously loaded
pages. I'm looking for a way to trigger a function call when a page is accessed using history.go(). Is there an event generated?
Just the normal events. But you can't tell how it was triggered. Meaning, when page1.html is accessed, it has no means of knowing whether it was loaded with the back button, the history.go or a direct link.
There is one exception I believe. If the document.referrer property is set,
if it has a value, no matter what it is, you may conclude with certainty the
trigger was no script. Only ordinary links clicked and followed in the
ordinary way, result in setting the referrer in browser memory.
--
hth
ivo http://www.ariel.shakespearians.com/
Thou shalt be free
"Ed Jay" <ed***@aes-intl.com> wrote in message
news:ja********************************@4ax.com... Randy Webb <Hi************@aol.com> wrote:
Ed Jay said the following on 1/1/2006 9:29 PM: I want to use history.go() to navigate between my previously loaded pages. I'm looking for a way to trigger a function call when a page is accessed using history.go(). Is there an event generated? Just the normal events.
For example?
But you can't tell how it was triggered. Meaning, when page1.html is accessed, it has no means of knowing whether it was loaded with the back button, the history.go or a direct link.
That's not a problem for my application. Is there a method for detecting what page the user came from when a page is accessed using history.go()?
No.
I'm trying to write an editing routine for a multiple-page application. Simple example:
Say I have three pages. The first two are 'data entry' pages and Page 3 is a reporting page. I enter data in a form on Page 1 and submit it via CGI to a script. On submitting the form, I set a flag on Page 1. The [Perl] script reads the form from Page 1 and generates Page 2 in which more data is entered in a form. This form is submitted, along with the data from Page 1 (in hidden input elements), to Page 3.
From Page 3, if I want to edit something on Page 1, I use history.go(-2) to navigate to Page 1 where I edit the data. On re-submitting Page 1, I check to see if my flag is set. If it is, I go directly to Page 3. Of course, when I reload Page 3 with the edited data from Page 1, I lose the data previously entered on Page 2. Short of saving the data from Page 2 to a file or in a cookie, I haven't been able to think of a way to reload Page 3 without losing the data.
Using PERL you could do something like the following (not my preference)
$params = "";
$params .= "var1=$var1value&" if ($var1value);
$params .= "var2=$var2value&" if ($var2value);
.... etc ...
print "<a href=\"page1.pl?$params\">Page1</a>";
So, you would pass all of the data from Page2 back to Page1. Then, on page
1 and 2 you do the same thing. Or you can use hidden inputs on your forms.
You would need to include all variables on each page so that they carried
through all the time no matter which page you go to.
What I would suggest is using something that is session aware, like Java.
Then, you could use a Java Bean to keep track of all of the data, no matter
what pages they went to and what data they filled out.
My path to a solution brings me to using history.go(2) on Page 1 to get to Page 3 with its Page 2 data still intact, but how to update Page 3 with the new Page 1 data? I can envision ways to bring the data to Page 3, but I need something to let me know when Page 3 is available to receive the edited data. I tried using onLoad() to call a script, but fetching the page from the browser history didn't work. There doesn't seem to be an onLoad event.
What's this poor newbie to do?
-- Ed Jay (remove M to respond by email)
Ed Jay said the following on 1/1/2006 10:46 PM: Randy Webb <Hi************@aol.com> wrote:
Ed Jay said the following on 1/1/2006 9:29 PM:
I want to use history.go() to navigate between my previously loaded pages. I'm looking for a way to trigger a function call when a page is accessed using history.go(). Is there an event generated? Just the normal events.
For example?
onunload
onload in the loaded document
<snip> I'm trying to write an editing routine for a multiple-page application. Simple example:
Say I have three pages. The first two are 'data entry' pages and Page 3 is a reporting page. I enter data in a form on Page 1 and submit it via CGI to a script. On submitting the form, I set a flag on Page 1. The [Perl] script reads the form from Page 1 and generates Page 2 in which more data is entered in a form. This form is submitted, along with the data from Page 1 (in hidden input elements), to Page 3.
Page 3 would have 3 buttons:
<input type="button" value="Edit Page 1" onclick="edit('page1.html')">
<input type="button" value="Edit Page 2" onclick="edit('page2.html')">
<input type="submit" value="Submit The Report">
Where the function edit would look something like this:
function edit(pageToEdit){
document.formName.action = pageToEdit;
document.formName.submit();
}
It would submit the page to 3 possible places:
Page1
Page2
Final Page
Page1 would check to see if the fields from Page2 got submitted to it.
If they did, make the Action of the form point to Page 3 and set hidden
fields for data from Page2.
Page2 would only have to see if fields from Page2 got submitted and
re-populate the form fields and set the fields for Page1 in hidden fields.
--
Randy
comp.lang.javascript FAQ - http://jibbering.com/faq & newsgroup weekly
Javascript Best Practices - http://www.JavascriptToolbox.com/bestpractices/
On 2006-01-02, Ed Jay <ed***@aes-intl.com> wrote: Randy Webb <Hi************@aol.com> wrote:
Ed Jay said the following on 1/1/2006 9:29 PM: I want to use history.go() to navigate between my previously loaded pages. I'm looking for a way to trigger a function call when a page is accessed using history.go(). Is there an event generated?
Just the normal events.
For example?
But you can't tell how it was triggered. Meaning, when page1.html is accessed, it has no means of knowing whether it was loaded with the back button, the history.go or a direct link.
That's not a problem for my application. Is there a method for detecting what page the user came from when a page is accessed using history.go()?
No.
I'm trying to write an editing routine for a multiple-page application. Simple example:
Say I have three pages. The first two are 'data entry' pages and Page 3 is a reporting page. I enter data in a form on Page 1 and submit it via CGI to a script. On submitting the form, I set a flag on Page 1. The [Perl] script reads the form from Page 1 and generates Page 2 in which more data is entered in a form. This form is submitted, along with the data from Page 1 (in hidden input elements), to Page 3.
From Page 3, if I want to edit something on Page 1, I use history.go(-2) to navigate to Page 1 where I edit the data.
Don't.
Re-generate a page 1 look-alike with hidden fields containing the page two
data. You could organise the fields on this fake page 1 so they look to
the perl like the fields on page 2
another way would be to store all the submitted data on the server.
Bye.
Jasen
"Sean Berry" <se**@buildingonline.com> wrote: "Ed Jay" <ed***@aes-intl.com> wrote in message news:ja********************************@4ax.com.. . Randy Webb <Hi************@aol.com> wrote:
Ed Jay said the following on 1/1/2006 9:29 PM: I want to use history.go() to navigate between my previously loaded pages. I'm looking for a way to trigger a function call when a page is accessed using history.go(). Is there an event generated?
Just the normal events. For example?
But you can't tell how it was triggered. Meaning, when page1.html is accessed, it has no means of knowing whether it was loaded with the back button, the history.go or a direct link.
That's not a problem for my application. Is there a method for detecting what page the user came from when a page is accessed using history.go()?
No.
I'm trying to write an editing routine for a multiple-page application. Simple example:
Say I have three pages. The first two are 'data entry' pages and Page 3 is a reporting page. I enter data in a form on Page 1 and submit it via CGI to a script. On submitting the form, I set a flag on Page 1. The [Perl] script reads the form from Page 1 and generates Page 2 in which more data is entered in a form. This form is submitted, along with the data from Page 1 (in hidden input elements), to Page 3.
From Page 3, if I want to edit something on Page 1, I use history.go(-2) to navigate to Page 1 where I edit the data. On re-submitting Page 1, I check to see if my flag is set. If it is, I go directly to Page 3. Of course, when I reload Page 3 with the edited data from Page 1, I lose the data previously entered on Page 2. Short of saving the data from Page 2 to a file or in a cookie, I haven't been able to think of a way to reload Page 3 without losing the data.
Using PERL you could do something like the following (not my preference) $params = ""; $params .= "var1=$var1value&" if ($var1value); $params .= "var2=$var2value&" if ($var2value); ... etc ... print "<a href=\"page1.pl?$params\">Page1</a>";
So, you would pass all of the data from Page2 back to Page1. Then, on page 1 and 2 you do the same thing. Or you can use hidden inputs on your forms.
You would need to include all variables on each page so that they carried through all the time no matter which page you go to.
I've considered doing almost exactly as you suggest. I still may
experiment with it. The only issue I can see is that in reality, I have 7
pages of input and I've been concerned about how long it might take. What I would suggest is using something that is session aware, like Java. Then, you could use a Java Bean to keep track of all of the data, no matter what pages they went to and what data they filled out.
I think a hidden frame as a scratch pad would be more viable. I'm
concerned over statements I've read that when using frames, history.go()
isn't reliably implemented. My path to a solution brings me to using history.go(2) on Page 1 to get to Page 3 with its Page 2 data still intact, but how to update Page 3 with the new Page 1 data? I can envision ways to bring the data to Page 3, but I need something to let me know when Page 3 is available to receive the edited data. I tried using onLoad() to call a script, but fetching the page from the browser history didn't work. There doesn't seem to be an onLoad event.
What's this poor newbie to do?
-- Ed Jay (remove M to respond by email)
Thanks for the suggestions.
--
Ed Jay (remove M to respond by email)
Randy Webb <Hi************@aol.com> wrote: Ed Jay said the following on 1/1/2006 10:46 PM: Randy Webb <Hi************@aol.com> wrote:
Ed Jay said the following on 1/1/2006 9:29 PM:
I want to use history.go() to navigate between my previously loaded pages. I'm looking for a way to trigger a function call when a page is accessed using history.go(). Is there an event generated?
Just the normal events.
For example?
onunload onload in the loaded document
I'm sure onUnload will work. I've proven to myself that onLoad() doesn't.
If it did, I think my problem would be solved. I'm trying to write an editing routine for a multiple-page application. Simple example:
Say I have three pages. The first two are 'data entry' pages and Page 3 is a reporting page. I enter data in a form on Page 1 and submit it via CGI to a script. On submitting the form, I set a flag on Page 1. The [Perl] script reads the form from Page 1 and generates Page 2 in which more data is entered in a form. This form is submitted, along with the data from Page 1 (in hidden input elements), to Page 3.
Page 3 would have 3 buttons:
<input type="button" value="Edit Page 1" onclick="edit('page1.html')"> <input type="button" value="Edit Page 2" onclick="edit('page2.html')"> <input type="submit" value="Submit The Report">
Where the function edit would look something like this:
function edit(pageToEdit){ document.formName.action = pageToEdit; document.formName.submit(); }
It would submit the page to 3 possible places:
Page1 Page2 Final Page
The above scheme is exactly what I have. Page1 would check to see if the fields from Page2 got submitted to it. If they did, make the Action of the form point to Page 3 and set hidden fields for data from Page2.
Page2 would only have to see if fields from Page2 got submitted and re-populate the form fields and set the fields for Page1 in hidden fields.
An interesting approach. Thanks...I'll pursue it.
--
Ed Jay (remove M to respond by email) This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics |
by: Tim Marsden |
last post by:
Hi,
If I navigate from Page1 to Page2 then to Page3, using the
response.redirect.
When the user press the Back button, I what then to go to Page 1 and start
again, not Page2. I dont want the...
|
by: Matt Mercer |
last post by:
Hi all,
I am having a frustration problem, and I have read about 25 newsgroup
postings that do not have a satisfying answer :)
The problem appears to be common where carriage returns are lost...
|
by: Nathan |
last post by:
I have an aspx page with a data grid, some textboxes, and an update button.
This page also has one html input element with type=file (not inside the data
grid and runat=server).
The update...
|
by: Coleen |
last post by:
Hi all :-)
I need to redirect to multiple pages on click of a transmit button, without
redisplaying each page. This redirection is to capture session variables
that are created on each page and...
|
by: Scott Shuster |
last post by:
Hi,
I've been searching and testing and have not yet found the answer I'm
looking for.
I have an ASP.NET (vb) application with an ecommerce function. When
the user submits the page, I DON'T...
| |
by: divya |
last post by:
I have a page name edit.asp which should expire immediately .The user
cannot open this page directly he has to provide a password for
entering this page.thus when the user enters edit.asp , it has...
|
by: laryten |
last post by:
Hi,
Is there a way to update the same web page instead of getting a new
page each time we click the submit button? The simplest thing to do is
to delete the current page (or go back to the...
|
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...
|
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...
|
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,...
|
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...
| |
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...
|
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,...
|
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...
|
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...
|
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...
|
by: adsilva |
last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
| |
by: muto222 |
last post by:
How can i add a mobile payment intergratation into php mysql website.
| |