I hope this isn’t breaking any rules here. I’ve been struggling with a personal web project for the past week, and I’m hoping some smart people here could get me pointed in the right direction.

I’ve already posted a full explanation in another community here, with some informational comments.

Long story slightly shorter… trying to get a website that is great for scoring a tennis match, and making it work offline so I can have it run locally on an offline machine. For some reason that I can’t figure out, the js refuses to work as expected.

First, I thought there may have been a CORS issue. And, the js is checking the protocol and changing it from “file” to “http” (see comments in like above). I worked past this issue, but it’s still not really working.

Now, I can see the first action of the “score” function is working (it logs to console), but nothing after that does anything at all, and I can’t figure it out!

Edit: A very kind person (what’s the lemmy equivalent for “redditor”?) offered some insight through a DM that got me on the right track! I won’t put all the details here because it could be considered borderline “unethical” if the wrong person was trying to follow my path. Thanks to that person and to the community! Ive learned a lot in the past weeks.

  • defunct account
    link
    fedilink
    21 year ago

    If you don’t mind me asking, why this scorekeeper? The fact that it isn’t open-source leaves me hesitant to dig around in the code.

    • @captsneezeOP
      link
      31 year ago

      I don’t mind. I’m locked into this one because it functions well, handling all of the idiosyncrasies that can be involved in tennis scoring (3 vs 5 game sets, tie breaks, etc.).

      It started as “I could use this for table tennis scoring at our cabin, it can’t be the at hard…” (we use tennis scoring instead of ping pong scoring because we’re all tennis players), but now I just feel like it’s a challenge I want to figure out.

  • @Dankenstein@beehaw.org
    link
    fedilink
    1
    edit-2
    1 year ago

    get rid of these:

    in the JS, this is what tries to redirect you:
    
    location[_0x15ea[0]] != _0x15ea[1] && (location[_0x15ea[2]] = _0x15ea[1] + window[_0x15ea[4]][_0x15ea[2]][_0x15ea[5]](window[_0x15ea[4]][_0x15ea[0]][_0x15ea[3]]));
    
    in the HTML:
    
    <link rel="canonical" href="https://scorecount.com/tennis/" />
    
    <meta property="og:url" content="https://scorecount.com/tennis/" />
    
    <script async src="https://www.googletagmanager.com/gtag/js?id=UA-199625911-1"></script>
    <script>
      window.dataLayer = window.dataLayer || [];
      function gtag(){dataLayer.push(arguments);}
      gtag('js', new Date());
    
      gtag('config', 'UA-199625911-1');
    </script>
    <div class="adwrap"></div>
    

    change these to these:

    in the HTML:
    
    https://scorecount.com/tennis/onilne-tennis-scoreboard.jpg
    onilne-tennis-scoreboard.jpg
    
    https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js
    jquery.min.js
    
    https://scorecount.com/files/scoreboard300.png
    scoreboard300.png
    

    put all these files in the root folder:

    onilne-tennis-scoreboard.jpg
    jquery.min.js
    scoreboard300.png
    

    Still doesn’t seem to want to update when an action is performed though.

    There is also a “bg.png” but I don’t think that’s causing issues.

    Pretty much everything works except for the score tracking lmfao

    • @captsneezeOP
      link
      21 year ago

      Thanks! I had already worked out the first bit and the last bit, but I hadn’t thought to look at that middle part. I appreciate your time and insight.