6 Replies Latest reply on Jan 23, 2015 6:25 AM by BKBK

    Manipulating the browser history

    miked77835589

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

        • 1. Re: Manipulating the browser history
          BKBK Adobe Community Professional & MVP

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

          • 2. Re: Manipulating the browser history
            miked77835589 Level 1

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

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

            • 3. Re: Manipulating the browser history
              BKBK Adobe Community Professional & MVP

              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>

              • 4. Re: Manipulating the browser history
                miked77835589 Level 1

                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).

                • 5. Re: Manipulating the browser history
                  BKBK Adobe Community Professional & MVP

                  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".

                  • 6. Re: Manipulating the browser history
                    BKBK Adobe Community Professional & MVP

                    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.