Results 1 to 2 of 2

Thread: [RESOLVED] Another MS Edge Issue

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2012
    Posts
    1,310

    Resolved [RESOLVED] Another MS Edge Issue

    This one has taken me quite a while just to find the source of the problem. With Firefox (any version), if you step through a cached page without refreshing the page, it does not execute. With Edge, just stepping through the page to get back to the start page causes the script to execute.

    Is this normal, and how do I get around the issue? I tried telling the page not to cache, but it just ignores it in both browsers.
    Code:
        <meta http-equiv='cache-control' content='no-cache'>
        <meta http-equiv='expires' content='0'>
        <meta http-equiv='pragma' content='no-cache'>
    Script:
    Code:
    <!DOCTYPE html>
    <HTML>
      <HEAD>
        <meta charset='utf-8'>
        <TITLE>Update</TITLE>
        <script type='text/javascript' src='./bear.js'></script>
      </HEAD>
    <BODY>
      <button id="cont1">CONTINUE!</button>
      <script>adjust()</script>
      <script type="text/javascript">
      document.getElementById("cont1").onclick=function(){location.href="./";};
      </script>
    </BODY>
    </HTML>
    J.A. Coutts
    Last edited by couttsj; Feb 8th, 2022 at 05:52 PM.

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Dec 2012
    Posts
    1,310

    Re: Another MS Edge Issue

    Finally solved this problem. To ensure that the script only gets run once per session, I used "sessionStorage".
    Code:
    <!DOCTYPE html>
    <HTML>
      <HEAD>
        <meta charset="utf-8">
        <TITLE>Update</TITLE>
        <script src='./bear.js'></script>
      </HEAD>
    <BODY>
      <button id="cont1">CONTINUE!</button>
      <script>
        var run1=sessionStorage.getItem("run");
        console.log(run1);
        if(run1==null){
          adjust()
          sessionStorage.setItem("run","Already Run");}
      </script>
      <script type="text/javascript">
        document.getElementById("cont1").onclick=function(){location.href="./";};
      </script>
    </BODY>
    </HTML>
    I would still like to know if this anomaly is present in other browsers such as Chrome.

    J.A. Coutts

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width