3 ms·
What might be a good idea for Javascript-heavy web apps is to make an Ajax call to the server to see if a refresh of the page is required.
by oakwhiz 14y ago
What might be a good idea for Javascript-heavy web apps is to make an Ajax call to the server to see if a refresh of the page is required.
- moreati 14y agoPlease don't do that. I left that tab open on purpose, I'm half way through reading the page - if the page refreshes I likely lose my position
- iamjustlooking 14y agoYou don't have to refresh the page, you could make it so that your next page click loads the full page instead of using ajax/pjax. quick pjax e.g.: <html data-lastupdated="1234567890"... $.getJSON('/lastupdated.json', function(lastupdated) { if(lastupdated > $('html').data('lastupdated')) { $('a[data-pjax]').removeAttr('data-pjax'); } });
- oakwhiz 14y agoThis is exactly what I meant by my initial comment - I should have been more clear.
- ______ 14y agoYou don't have to force a reload, you can just suggest that the user reloads. Eg: "Please reload the page to get the latest version"
- jacobolus 14y agoPlease don’t even call out to the server, unless I actively interact with the page. I sometimes open 50 or 60 browser tabs at once, and when I unsleep my laptop or connect to a new wifi hotspot, many of them try to simultaneously make such ajax calls, which prevents any other web pages I want to open from loading until those calls either make it through or time out. Occasionally I have to SIGSTOP my main browser and open a different one if I need to access something online right away. Even pages of ostensibly static content, like years-old news articles, now are littered with "web 2.0" doodads on them which do this kind of crap.
- lifeisstillgood 14y agoPlease don't take this the wrong way but why do you have 50-60 browser tabs open? Are you using browser tabs as some sort of todo list? Isiteffective?
- oakwhiz 14y agoThere have been days when I have had more than 100 browser tabs open. Users should be able to have as many tabs as they want.
- lifeisstillgood 14y agoThat was not the question - I am paying to have a small office to reduce my distractions, and allow focusing. I am just interested in how people manage the distractions, and with 100 tabs open I would presume that they are not all open regarding the same single task at hand.
- AndrewDucker 14y agoThey aren't. Most of them are open from other tasks. But that doesn't make them a distraction. They're there for when the current task finishes and I can go back to them. The alternative is to close them all down and reopen them, which is vastly more time consuming.
- jes5199 14y agoI currently have 42 tabs open in Chrome (in two separate windows). Yes, it's like a todo list. It would work better if I had a mechanism to de-duplicate tabs that were open to the same URL - sometimes I find that I've got three tabs open all monitoring the same CI build. But I also keep several JIRA bugs open in tabs so I don't forget them, two Gmail accounts and twitter, I've got five-ish articles that I was in the middle of reading, some reference documents for a few projects I'm in the middle of, a couple of youtube videos that I haven't found time to watch yet...