Jump to content

Roavin

Members
  • Posts

    3
  • Joined

  • Last visited

  • Days Won

    1

Roavin last won the day on July 25 2019

Roavin had the most liked content!

Profile Information

  • Leader Name
    Jonathan Relean
  • Nation Name
    Roavin
  • Nation ID
    148271
  • Alliance Name
    New Pacific Order

Contact Methods

  • Discord Name: Roavin#5410

Recent Profile Visitors

The recent visitors block is disabled and is not being shown to other users.

Roavin's Achievements

New Member

New Member (1/8)

26

Reputation

  1. @Alex - So, I see that while the code has now changed on the live site, the effect is still happening, especially when there's a very slow loading flag on the war page (like for me right now - Bamika's image takes 7 seconds to load, wtf). Given that I proposed the prospective fix and it's still not working right, I felt somewhat obligated to investigate further After dabbling around, I believe I've found the problem, though I'm not 100% certain on how best to fix it. I suspect the issue is Rocket Loader, which is injected by Cloudflare to asynchronously defer various blobs of Javascript for the purpose of making the page load faster. Apparently it works by replacing script type attributes with a prefixed version thereof (for example, prefix "bce348fb34a3edbcc529509b-"), then later going back and loading them on the side. Quite an insane piece of tech, honestly. If that is indeed the case, then why it's broken is clear - that piece of javascript to bind the drop down actions isn't executed immediately with the load, but rather much later whenever Rocket Loader feels like it. I can think of three potential ways of fixing it: Add data-cfasync="false" to the script tag, as described here. The problem here is that the snippet requires jQuery, so the script tag for loading jQuery in the head section needs that attribute as well. As above, except instead of also "synchronously" loading jQuery, replace that snippet with a vanilla js based version. Good ol' document.getElementsByClassName() should do the trick. Turn off Rocket Loader entirely in the CloudFlare settings. This may fix other potentially wonky places as well, though it may make the site "feel" slower (or faster, depending on how the browser rather than CloudFlare decides to schedule things like Bamika's insanely slow image. *phew*. While I'm here, a question: Would you mind if I rig up a piece of Greasemonkey code to replace that dropdown with individual buttons and/or keybinds?
  2. This isn't a problem on @George Clooney's side, this is a bug. This is something that happens sporadically with any option besides nuclear, and the reason is quite simple: <script type="21a01513a89b768abbb4d894-text/javascript"> $(function(){ // on change event to select $('.actionselector').on('change', function () { var url = $(this).val(); // get selected value if (url) { // require a URL window.location = url; // redirect } return false; }); }); </script> The above snippet is wrapped in $(), which means it's executed when the DOM is ready. However, analytics and all those other extra goodies just love taking forever sporadically (on any website, not just PnW), so even though the page looks loaded to the user, the DOM ready callbacks haven't fired yet. Usually things are placed at DOM ready so that whatever elements are being referenced are sure to be loaded, but ironically it's not even needed at this point, since the above <script> is placed after the actionselector <select> element is declared but before all of those wonderful extraneous goodies. So the solution is simple - take it out of $(), and it works. @Alex
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use and the Guidelines of the game and community.