V
Victor
Hi everybody,
could anybody kindly give me a clue in dealing with a following problem
:
I am developing a project, where the user navigates from page to page
by means of links referring to JavaScript functions that do some
processing of forms dispersed over those pages. Each page has its own
element 'page' as an identifier. This processing occurs through a call
for a function, which gets the id of the target page (looks like
'move(id)'), finds out the id of the currently opened page and based on
that calls a proper processing function; then it brings the user to the
required page 'id'. All this stuff works brilliantly, but I encounter a
problem when the user clicks the "Back" button of a browser.
The page gets properly changed, no wonder. And the navigating link
contains now a proper value as 'id' - but calls for a function that
would be called on the page, where the "Back" had been clicked...
I'll try to explain it more thouroughly with the following example:
Page (7) contains a link with href='javascript:move(3)'. Should this
link get clicked, the function move() would analyze the current page,
find out an element 'page=7', call a function Func7() for processing
the form on the page 7, thereafter I would jump to the page 3.
Now I press the "Back" button of the browser and navigate to the page
2, from where I had changed to the page 7. I get the page 2 displayed;
this page contains link with href='javascript:move(4)'. So, I hope by
clicking this link to call the function Func2() - because there is
element 'page=2' on this page - for processing the form on the page 2,
and then to jump to the page 4. It would work exactly this way, had I
come to the page 2 by using the link with href='javascript:move(2)' on
the page 7. But I did not, I navigated here a different way - through
the button "Back".
So now instead of calling the Func2(), the link 'move(4)' on the page 2
calls for Func7(), as if I still were on the page 7...
What is going wrong here?
Many thanks in advance
Victor
could anybody kindly give me a clue in dealing with a following problem
:
I am developing a project, where the user navigates from page to page
by means of links referring to JavaScript functions that do some
processing of forms dispersed over those pages. Each page has its own
element 'page' as an identifier. This processing occurs through a call
for a function, which gets the id of the target page (looks like
'move(id)'), finds out the id of the currently opened page and based on
that calls a proper processing function; then it brings the user to the
required page 'id'. All this stuff works brilliantly, but I encounter a
problem when the user clicks the "Back" button of a browser.
The page gets properly changed, no wonder. And the navigating link
contains now a proper value as 'id' - but calls for a function that
would be called on the page, where the "Back" had been clicked...
I'll try to explain it more thouroughly with the following example:
Page (7) contains a link with href='javascript:move(3)'. Should this
link get clicked, the function move() would analyze the current page,
find out an element 'page=7', call a function Func7() for processing
the form on the page 7, thereafter I would jump to the page 3.
Now I press the "Back" button of the browser and navigate to the page
2, from where I had changed to the page 7. I get the page 2 displayed;
this page contains link with href='javascript:move(4)'. So, I hope by
clicking this link to call the function Func2() - because there is
element 'page=2' on this page - for processing the form on the page 2,
and then to jump to the page 4. It would work exactly this way, had I
come to the page 2 by using the link with href='javascript:move(2)' on
the page 7. But I did not, I navigated here a different way - through
the button "Back".
So now instead of calling the Func2(), the link 'move(4)' on the page 2
calls for Func7(), as if I still were on the page 7...
What is going wrong here?
Many thanks in advance
Victor