« first day (3751 days earlier)      last day (1180 days later) » 

1:05 AM
@JBis Thanks, JBis. It doesn't contain a example code atm but you can find my question posted here: stackoverflow.com/questions/65837389/…
 
 
1 hour later…
2:21 AM
posted on January 22, 2021 by Bindu Suvarna

Hi, everyone! We've released Chrome Beta 88 (88.0.4324.111) for iOS: it'll become available on App Store in next few days. You can see a partial list of the changes in the Git log. If you find a new issue, please let us know by filing a bug. Bindu Suvarna Google Chrome

 
 
7 hours later…
8:54 AM
@BlackPanther If you struggle with basic JS, you're going to have fun with TS
 
user14128818
Is there any one who can help me to do this question please stackoverflow.com/questions/65840747/…
 
@rabinadhikari Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
1747
Q: What is the XY problem?

GnomeWhat is the XY problem? When asking questions, how do I recognize when I'm falling into it? How do I avoid it? Return to FAQ index

If they aren't logged in, have your dashboard redirect to the login page. You don't need to physically disable the back button (which you can't do)
 
isnt it true that the back button behaves differently than just going to the url of the previous node in the history?
sometimes the back button just loads the stuff from cache... or something
 
9:11 AM
It depends on how the site is implemented, if they're using pushState to override the history
 
user14128818
@Wietlol Thank for your interest . Actually when you logout gmail than it display logout page and without doing any activities on browser just click on browser back button then it redirect to login page . but in my case when i logout than i sucessfully went to logout page but than when i clicked on browser back button than it shows my dashboard
 
did you forget to forget the authentication?
 
> forget the forget
 
how do you keep information of a user being authenticated?
 
* gives Wietlol ☕ *
 
9:13 AM
@KarelG fixed it
 
user14128818
@BenFortune thank but i already tried push state but push state works if you click on browser and than you click on browserback button which means it works after popstate event on crome
 
||forget forget
 
That command doesn't exist
 
@rabinadhikari I'm not telling you to use it
 
thank you
 
user14128818
9:14 AM
@BenFortune sorry I might understood wrong
 
user14128818
@Wietlol does authentication plays any role on this topics?
 
yes
 
if you can see the dashboard while using the back button post-log out then you may miss something important: check if the user is really authenticated.
 
You're just giving people willy nilly access to your dashboard without authenticating?
 
if you can see your own dashboard, the website still knows who is logged on
 
9:15 AM
if the user is not, you have to redirect him to the login screen
 
when logging out, you should forget that information
 
that just solves your problem
 
but you probably forgot to do that
 
user14128818
no i allows the user after authentication
 
another thing you should do is to invalidate the authentication token
this way, you wont rely on it being forgotten, but just wont accept the token any more
doing both is still best
 
user14128818
9:17 AM
@Wietlol does i have to check the authentication on widows load event
 
it depends on how you store it
 
user14128818
@BenFortune It needs authentication to access
 
user14128818
When it back to dashboard and if you refresh the page than it redirect to login page
 
user14128818
cuz session will be deleted on click event of logout button
 
if you click the back button, is there a request to the web server to load the dashboard?
if not, then your problem is in the cache
 
user14128818
9:19 AM
no
 
user14128818
cache problem?
 
if you do not send a request to the server, then how does the browser show the dashboard?
it must be loading it from the local cache
 
user14128818
@Wietlol there is a cache history
 
user14128818
Can we clear cache after logout using jquery or js
 
user14128818
?
 
9:21 AM
iDunno
 
It sounds like he's not redirecting if the session is invalid
 
how does the session get validated if there is no request to the server?
 
user14128818
@BenFortune you are redirecting
 
user14128818
sorry [
 
As above, pressing back doesn't hit cache unless you're manipulating it with the history api
 
9:23 AM
@rabinadhikari dear gods, no. That would be horrible. Imagine if you go to a website that nukes your entire history and logs you out and so on.
 
user14128818
i am not redirecting to server when i click browser back
 
jesus christ
 
What you can do is set the headers on a resource and specify for it not to be cached. Browsers will then fetch a fresh version of it every time.
 
The first thing your page should be doing, is checking for a valid session if you're relying on authentication. If that fails, you should redirect them to a login page
again
1747
Q: What is the XY problem?

GnomeWhat is the XY problem? When asking questions, how do I recognize when I'm falling into it? How do I avoid it? Return to FAQ index

This has absolutely nothing to do with the functionality of the back button
 
user14128818
@BenFortune I think checking session on server on load events may works .
 
user14128818
9:25 AM
Thank you all i will try that out
 
So you don't already do that, okay
 
user14128818
@BenFortune yea i haven`t tried to check searver on load event
 
11:57 AM
@JBis
I still dont get it... you kept saying it was free... but at every turn I see more dollar signs
Im assuming trial credit means that you have to pay back any of it that you use
And to reply to your question before
I want to host both the backend and the frontend
So, yeah, I wanted a VM... but Im still not sure if its free, and Im really trying to save up for something else, so Id rather not spend anything at all
well... whatever, Ive lost my patience, Iill just go ahead and make one and see what happens..
 
12:32 PM
@user9745220 Please don't post unformatted code - hit Ctrl+K before sending, use up-arrow to edit messages, and see the faq. You have 25 seconds to edit and format your message properly before it will be removed. Please separate code blocks from your actual question. Put your question in 1 message and then your code in a 2nd and format it.
For posting large code blocks, use a paste site like like gist.github.com, hastebin.com, pastie.org or a demo site like jsbin.com
@user9745220 Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
1 message moved to Trash can
 
btn.addEventListener('click', function () {
  const newScreen = new Screen();
  newScreen
    .getReports()
    .then(data => {
      console.log('kaa');
      newScreen.renderReports(data);
    })
    .catch(err => console.error(`Something went wrong ${err.message}`));
});
Is this a good practice of creating and using classes?
 
@user9745220 As long as youre getting new instances of a class using new className() then how you use it is completely up to you
Looks fine to me
However
If youre retreiving a class in a click method
be warned that youll be creating a new Screen() every time you click\
 
I'm really new to JS, but I'm using this class to fetch some data from API and then render it to the screen
class Screen {
  constructor() {
    console.log('Created screen');
  }

  getReports = async function () {
    try {
      const res = await fetch('http://192.168.0.95:8080/api/reports/', {
        headers: {
          'Content-Type': 'application/json',
          //Authorization: `Token ${testToken}`,
        },
      });

      if (!res.ok) throw new Error(`Something went wrong.. ${res.status}`);

      return res.json();
    } catch (err) {
      throw err;
    }
  };

  renderReports(reports) {
 
if you just need to render reports...

Put `const newScreen = new Screen()` OUTSIDE of the click listener
yes, thats fine, just make sure to place const newScreen = new Screen() before the event listener
not inside of it
because youre creating a new screen every time you click
which is relatively inneficient
 
ok, I thought before by doing that, but I also tried to do it in this way and didn't really noticed anything
yeah, I understand now, thanks:)
also the class itself looks good to u?
 
12:37 PM
Because youre creating a new screen and rendering it, its functionally the same

its just more efficient and realistic to be creating 1 instance and using it globally
You normally wont notice anything, but if that class gets big enough, or you click it enough times, youll probably notice memory spikes
and eventually performance issues
 
hmm, let me refactor it for few mins, I'll send the code here
 
Also when sending code, you can use external sites like JSfiddle or Repl.IT

or just send it in a pastebin / hastebin or something
so that it doesnt fill up the chat
 
@MisterSirCode no, trial credit is free
as in trial
 
If you go over, that's when you'll need to pay
 
12:46 PM
@BenFortune Completely? alright, thats convenient. Thanks
 
Yes, that's generally what a free trial is...
 
@user9745220 Try putting it on jsfiddle.net so that its easier for other users to see, run and debug your code
it also makes it a lot easier to edit it
And you can run it alongside CSS and HTML
HOT DAMN
0 SECONDS
NOICE
Cloudfare is pretty useful... why the hell havent I been using this for years
 
CDN is an incredibly interesting concept
Cloudflare is providing that as a part of the service, so
 
I do love seeing blank pages in 0 seconds
 
Lol.. Ive just yet to direct my page to the DNS
sadly this shitty school firewall apparently dislikes the site anyways...

So all I can do is toy around with the DNS and the Hoster
plus some backend stuff via Google Cloud...
 
1:01 PM
@MisterSirCode Stay within this:
and even if you fuck up, you get a $300 credit for first year ($300 in free money)
you do need a credit card tho
@MisterSirCode the estimate is stupid
@MisterSirCode their cdn isn't their best part
cloudflare is moving internet forward with their work on various internet protocols
 
well, either way, its all running smoothly now
Ive literally got a linux VM running in a chrome window on a windows 10 computer at school
so Im happy
 
nice, those names are region names in kube contexts
 
This is all extremely hard to imagine
Never thought I could virtually create servers
I seriously wonder how I miss this stuff
 
now you can go around and tell people you created a cloud
 
Well I think people are more scared of the fact of my Linux shell outputting install information
if I put it in fullscreen mode, they think Im hacking the computer... or whatever the hell they believe
kids are weird
Like... sure it just an information tree
but to people who arent familiar with an update tree, it looks sketchy to them
and adults / teachers? even more so
 
1:11 PM
once you have linux setup, setup a db (preferably postgres) and then node and start developing
 
Oh... I was planning on going the lazy route and just making an apache network and connecting it to my current code
but that way is more flexible, so Ill probably swap to it
anyhow, I installed a virtual desktop and things, so I should be able to remotely connect to it and manage it from there
 
@MisterSirCode wdym?
you still need to build a backend to replace you firebase
 
@JBis Yeah, I was planning on creating a debian apache network.. and hosting it to my DNS
like a good ol' PHP apache network
However it seems really dated and static now that I think about it
 
i'd suggest nginx + node
you proxy the domain to localhost:5000 or whatever
 
Yeah, like I saw you mentioned above
plus Im more familiar with node nowadays anyhow
and I havent written PHP in years
 
1:34 PM
lol Ive already had to reset my VM... Im never good with linux
I always wound up screwing internal settings or apps
and breaking the OS...
 
just setup ubuntu
sidenote, digital ocean has a bunch of really good articles on linux server administration if you ever need help
 
@JBis Im already using Ubuntu LTS 20 Minimal
I just tend to screw up install commands
and wound up fuckin up some internal setting or something
 
what are you installing?
 
XFCE Desktop + XScreenSaver for compatibility

Google Chrome Remote Desktop for Debian
etc
 
no
why are you trying to connect desktop? just use command line
 
1:43 PM
@JBis Because I struggle with completely text-based development
and yes I know I could just setup a remote git pull
and develop from my pc
but it would be interesting if I could just use the built in virtual machine
 
@MisterSirCode yeah don't do that
you will def run over the free limit
just use it for deployment, git pull, etc.
 
oh wells, I guess Ill live with a command console
/shrug
 
sup guys. anyone of you good at pub/sub pattern? Or just deciphering non noob code for a newbie?
 
|| welcome brat
 
@brat Welcome to the JavaScript chat! Please review the room rules. If you have a question, just post it, and if anyone's free and interested they'll help. If you want to report an abusive user or a problem in this room, visit our meta.
 
1:48 PM
Thanks JBis :)
anyways. three rows that I dont understand, pointed out with comment and <---- arrow in this fiddle. If anyone is interesetd.
*interested xD
oop. should paste it lol
 
@brat ".hasOwnProperty without arguments ???" -> stackoverflow.com/questions/15886272/…
 
@MisterSirCode you've a core ubuntu (without GUI) and you want to install GUI based tools?
 
@brat "using call on a boolean" - see above. It's a function reference, not a boolean
 
will check!
-1 I guess is cuz push returns length? will check that as well...
 
user14692552
Stupid question, but you cant use $.getJSON('') to access a SharePoint list data into JSON right?
 
1:57 PM
ah! right! throwing around functions, then you dont use the paranthesis xD
 
@codingdreaming Does SharePoint expose an API that returns JSON?
 
that would be a dream coming true
 
wtf is share point and why are so many people trying to fuck with it?
 
user14692552
Don't think so. I've successfully done with a REST API but was just curious if there was an easier way about it
 
MS platform that a lot companies have as "part of" their CRM
 
1:59 PM
@JBis It's a Microsoft thing. Their platform for intranet stuff (mostly). Integrates with MS Office. From what I know, it's horrible.
 
it's a nightmare for developers but easy-to-use for people working in support ect
 
considering everyone seems to want to modify it, it does sound pretty terrible
 
user14692552
Nightmare may be an understatement
 
yeah, that's the problem; people wants custom tools
or custom-fit features
 
@KarelG That's precisely what I know about it. Ex-colleague went joined a company that develops sharepoint plugins. I really don't now why. He was also doing it in VB.NET
 
user14692552
2:00 PM
its a very useful intranet though
 
He didn't strike me as too odd until that point. Probably a bit more than the average developer but still - nowhere near "I'll go write VB for Sharepoint" level.
 
they should add js support to ms products instead of vba
wouldn't it be cool to write js scripts for excel
 
@VLAZ the company I work for got acquired and we're still in transition phase to get integrated in their corp CRM. Man, they insists that we have to move our CRM into Salesforce during the last major corp meeting. We're trying to get them off this idea.
 
user14692552
anyone familiar with mustache.js
 
@JBis There is support for that. You can develop Office extensions in JS + HTML5. At least MS were talking about releasing a kit for that back in 2016. I can't remember if they had released it then or were going to. But they definitely wanted devs to get on it.
 
2:03 PM
our CRM is flexible and built from ground up, based on our products/service we offer to customer. And they want to throw this away with something awfully generic?
 
@VLAZ its a great idea
 
user14692552
@KarelG I would disagree with "awfully generic". It is generic for sure, but the UI is very user friendly for customers/partners
 
@JBis In theory - yes it is. But it's a Microsoft idea. They seem to have a penchant for turning good ideas inside out.
 
except i don't trust MS to embed a proper HTML5 renderer
 
@codingdreaming ---> and built from ground up, based on our products/service we offer to customers
read it as "custom tailored CRM"
 
2:05 PM
next thing you know we are going to get IE9 in MS Office 2020
 
user14692552
MS loves stripping your HTML and JS
 
there are a LOT things that we have that is not in SalesPoint
 
user14692552
and overwriting it with some stupid BS
 
they should just do custom JS lib + their own XML based elements
 
@JBis they had to even fork chromium for their edge browser
 
user14692552
2:06 PM
Microsoft needs to keel over and die
 
😁
 
@VLAZ would it not be easier to just replace it with ´´´!topics.hasOwnPropery(topic)´´´
 
user14692552
As a whole
 
@JBis Did you know that IE used to be dependant on Office? Back in IE6-ish days you could have two computers, with the exact same version of Windows, same patches, same exact version of IE but they work differently. Because they have different versions of MS Office and that for some reason comes adds DLLs for IE.
 
user14692552
IE doesn't support shit anymore
 
2:07 PM
IE never supported anything
 
@VLAZ is MS office that old?
 
I tried in VScode and it worked. Just seems easier to understand then an intermittent reference called hOP :-/
 
geez. you guys have tracked me off .... got work to do
 
I tried it and it worked on vs code/node
 
@KarelG Yeah. Word was around in the 90s.
 
user14692552
2:08 PM
In terms of SP, IE is supposed to be the "best". Implement any sort of custom script and IE breaks
 
Anyways. Thanks guys, u rock! :)
 
I'm shocked so many people like VS Code over anything jetbrains
I feel like Jetbrains is superior in every way
 
@brat technically that will work. It's a weird line to see there. It's possible that it's to protect from somebody overwriting hasOwnProperty on that object but it's an extremely weird situation to be in.
@JBis But isn't WebStorm (that's their JS product, right?) paid?
I use InjelliJ for Java and I'm happy with it. I use VSCode because it seems the least hassle of all the free editors for JS I've tried.
Last time I looked at WebStorm it required a paid license, so I didn't bother.
 
user14692552
IntelliJ is the environment I learned Java on when I studied Management Information Systems
 
user14692552
I love it
 
2:12 PM
WebStorm does but I think it's cheap. I'm also student so i get for free.
 
for what its worth. I chose VS for same reason as VLAZ. Came from Eclipse.
 
In professional environment it doesn't really matter tho right?
 
@brat Ouch. Eclipse was just horrible for writing JS. At least the last time I tried it.
 
> Eclipse was just horrible for writing JS. At least the last time I tried it.
 
@JBis You'd have to care about licenses. At least in most companies - a smaller one might give you more leeway but if they get audited and they are in breach, there is heavy penalties.
IntelliJ's community license does permit it being used in a corporate setting. So that's what I do.
 
2:15 PM
Yah. I just find the whole thing kinda buggy and erm... how should I put it... basically. I did not dare to try out plugins because afraid it would break, and also, kinda hard to know what plugin to use and so on and so on.
 
Yeah I guess that makes sense
Well their marketing team got me. Once I am done with school I will def buy a license regardless. Never switching off of the platform.
 
Did not want the tool to get in the way so to speak. but the k+c to comment out and k+u to undo that hehe. took a while
 
@MisterSirCode what
don't install DE's on servers
 
@brat "how should I put it..." I'd personally say that it's more fun stabbing myself with a fork in the foot.
 
LoL
 
user14692552
2:17 PM
I have this list with different teams and their reports from different weeks throughout the year. I'm using Mustache to populate it to a printable HTML Document. If I wanted to filter out/make searchable the WeekOf the reports, how would you maybe suggest going about that
 
do you just want a word search or what?
 
user14692552
Ya
 
user14692552
WeekOf is getting pulled through AJAX request, but is hidden and not used in the HTML doc. But I can still use it, should I just use an if statement
 

« first day (3751 days earlier)      last day (1180 days later) »