Highlighted

Manipulating the browser history

New Here ,
Jan 21, 2015

Copy link to clipboard

Copied

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

Views

1.3K

Likes

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

Manipulating the browser history

New Here ,
Jan 21, 2015

Copy link to clipboard

Copied

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

Views

1.3K

Likes

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
Jan 21, 2015 0
Adobe Community Professional ,
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.

Likes

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
Reply
Loading...
Jan 21, 2015 1
New Here ,
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)'.

Likes

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
Reply
Loading...
Jan 22, 2015 0
Adobe Community Professional ,
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>

Likes

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
Reply
Loading...
Jan 22, 2015 0
New Here ,
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).

Likes

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
Reply
Loading...
Jan 23, 2015 0
Adobe Community Professional ,
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".

Likes

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
Reply
Loading...
Jan 23, 2015 0
BKBK LATEST
Adobe Community Professional ,
Jan 23, 2015

Copy link to clipboard

Copied

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.

Likes

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
Reply
Loading...
Jan 23, 2015 0