• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Manipulating the browser history

New Here ,
Jan 21, 2015 Jan 21, 2015

Copy link to clipboard

Copied

ColdFusion doesn't work with 'browser history'-- 'window.history.go(-1)'.

Views

1.6K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 21, 2015 Jan 21, 2015

Copy link to clipboard

Copied

Coldfusion code runs on the server. The code 'window.history.go(-1)' is Javascript, which runs on the browser.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 22, 2015 Jan 22, 2015

Copy link to clipboard

Copied

CF 8,9,10 work with 'browser history'-- 'window.history.go(-1)'.

CF 11 doesn't work with 'browser history'-- 'window.history.go(-1)'.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 22, 2015 Jan 22, 2015

Copy link to clipboard

Copied

I have tested it with ColdFusion 11 (Build 11.0.03.292480) on Internet Explorer 11, Firefox 35 and Chrome. It works as expected.

My test files are as follows:

page1.cfm

<a href="page2.cfm">Go forward to page2.cfm</a>

page2.cfm

<a href="page3.cfm">Go forward to page3.cfm</a><br><br>

<button onclick="goBack()">Go back 1 page to page1.cfm</button>

<script type="text/javascript">

function goBack() {

    window.history.go(-1)

}

</script>

page3.cfm

<button onclick="goBack()">Go back 1 page to page2.cfm</button>

<script type="text/javascript">

function goBack() {

    window.history.go(-1)

}

</script>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Jan 23, 2015 Jan 23, 2015

Copy link to clipboard

Copied

BKBK,

our case is more complicated:

  • one 'page.cfm' has 2 html  <FORM NAME="state1" METHOD="post" >, <FORM NAME="state2" METHOD="post" > and 1 <cfgrid ... >.

It moves from one <form 1... > to <cfgrid ... > and then to <<form 2... > from <cfgrid ... > on the same page . On last <<form 2... > we have button< ... onClick="history.go(-1);" >.

It works on CF 8,9,10 but doesn't work on CF 11.

Chrome complains:

This webpage requires data that you entered earlier in order to be properly displayed. You can send this data again, but by doing so you will repeat any action this page previously performed.

Reload this webpage

Press the reload button to resubmit the data needed to load the page.

Error code: ERR_CACHE_MISS.

I think it's setup of CF 11 (page history).

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 23, 2015 Jan 23, 2015

Copy link to clipboard

Copied

Sorry to say that your explanation is unclear to me. In fact, I find it confusing.

You say "one 'page.cfm' has 2 html". Whereas there can only be one HTML tag per page. You also say "It moves from one <form 1... > to <cfgrid ... > and then to <<form 2... > from <cfgrid ... > on the same page ." . This seems to suggest a page containing 2 forms and 1 grid, including links and form-actions that point to the page itself. If so, then it will be absurd to attempt to go back to your current page.

In any case, the form attribute equivalent to a link is method="get". Whereas you are using method="post".

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jan 23, 2015 Jan 23, 2015

Copy link to clipboard

Copied

LATEST

miked77835589 wrote:

It works on CF 8,9,10 but doesn't work on CF 11.

Chrome complains:

As you yourself say, Chrome complains, not ColdFusion 11.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation