0

The html page looks like this:

    Cache-Control:no-store
    Connection:keep-alive
    Content-Encoding:gzip
    Content-Type:text/html
    Date:Tue, 04 Feb 2014 14:51:46 GMT
    Server:nginx/1.4.4
    Transfer-Encoding:chunked


  <html>
    <head>
        <script type=javascript>

    funciton buttonClick(){
        var box = document.getElementById("box");
        box.val = "aaaaaaaaaaaaaaaaaaaa";
    }

    </script>
</head>
<body>

<textarea id="box">bbbbbbbbbbbbbbbbbbbbb</textarea>
<button onclick="buttonClick">button</button>
</body>

</html>

First I click the button...#box.val == "aaaaaaaaa". Then I visit a different page and then click the back button. #box.val is still "aaaaaaaa" when it should be "bbbbbbbbbbb".

I can see the browser has made a request to the server for fresh html. However, the browser is displaying "aaaaaaaaaaa".

When I inspect the source of the page in the browser it has "bbbbbbbbbbbbbb" but it displays "aaaaaaaaaaaaaa".

My Chrome version is 32.0.1700.102

This doesn't happen in FF or IE. Is there anything I can do to prevent this problem.

Francis Snipe
  • 551
  • 2
  • 10
  • 20

1 Answers1

0

Your HTML tags are badly formatted (space before tag name). I did edit your post but also found other javascript detail issues corrected in below code.

Please try out with well formatted HTML. And let us know the outcome.

    <html>
        <head>
<META HTTP-EQUIV="CACHE-CONTROL" CONTENT="NO-STORE">
            <script type="text/javascript">

        funciton buttonClick(){
            var box = document.getElementById("box");
            box.val = "aaaaaaaaaaaaaaaaaaaa";
        }

        </script>
    </head>
    <body>

    <textarea id="box">bbbbbbbbbbbbbbbbbbbbb</textarea>
    <button onclick="buttonClick();">button</button>
    </body>

    </html>
Cedric Simon
  • 4,571
  • 4
  • 40
  • 52