JS Code: tomicevipezosi.rf.gd/blackjack.js
PHP/HTML/CSS Code: tomicevipezosi.rf.gd/blackjack.php
JS code for my blackjack game works fine on every local machine I’ve tested and online testers, but here it doesn’t. There is a function that calculates the value of your hand, and on InfinityFree server it returns normal values in the log, but weirdly in function playerHit, it returns number that’s bigger than it should be without any rule (I’ve seen 16->26, 13->29, etc.). My code is fully functional and this is a problem with InfinityFree servers.
Is this playerHit function a Javascript function? If so, then please remember that Javascript code runs entirely in the browser of the visitor. Any mathematical errors there can’t be the problem with our servers, because the only thing our servers do is make your Javascript files available to download and run by visitors. Our severs don’t do any computation, so there is no way the output could be different.
Is there a possibility that this may have been a problem in a previous version of your published website? If so, please verify whether this issue still exists in a Incognito Mode window. It might be that your browser has cached an old, incorrect copy of your script, and you’ll need to clear or bypass the cache to get the latest, correct code.
I know js is ran on the client’s side, but it works perfectly EVERYWHERE else, and then I upload it to your hosting, and suddenly it’s glitched out. I posted the same thing on reddit and some other forums all of the people told me my code is completely fine. I really have no idea how does the hosting matter, but it somehow does.
Open your website in your browser, and open dev tools. Grab the URL for the JS file, and open it in the browser. If the code there matches what is on the server, it’s not a server issue as the browser parses JS, not the server.
I’m going to try hosting your code on my PC tomorrow see if I can recreate the bug in my environment. But try checking if there are any other scripts on the page that might interfere with your code?
No, there is not. We just serve the website files that you upload, we don’t add, remove or change anything.
As for why your code would work everywhere else but not here, I don’t know, but I can tell you that we don’t do anything that could cause that.
The only way this could happen is if the code that’s being used on your website is different from the code elsewhere. That could be caused by browser cache, but you would be far from the first to accidentally forget to upload the right version of their code.