@RichardMišenčík Welcome to the JavaScript chat! Please review the room rules. Pleasedon't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
function xx(){
console.log("start!");
var start = new Date().getTime()
while ((new Date().getTime() - start) < 20000) {}
console.log("About 20 seconds of frozen eventloop")
}
On a completely different note, how would you help someone on Stack Overflow, when it's clear that they need to learn about a lot of things in order to achieve what they want?
I can't just give them the answer, that'd be a book.
So for example in this case, the asker seemed to think that $.get redirects the user. They also weren't clear on the whole client-server model of the web. What they want, is a progress bar on a pge, updating based on the progress of a long-running server process.
So he'd have to know the basics of how the web actually works, updating a page using AJAX polling, running tasks on the server in the background, or in a worker queue of some sort, ...
There's a whole bunch of concepts envolved in explaining htis answer, that the asker clearly doesn't grasp
It took me a while to understand the whole thing, because I forgot setTimeout accepts a string of code
@monners no it doesn't
the b="..." expression just assigns the code string to b. But an assignment expression returns whatever was assigned, so that's also the argument for eval
although given that you two are on different continents and have different times of dawn...those are going to be some big ass pistols and one person is going to be shot hours before the other
I need an idea to protect session data being sent from a node server to my friendly ajax/javascript. I was thinking of updating the cookie with an encrypted random id - on every major action - (I'm loading a page - as opposed to updating an item, I'm making a purchase) etc. but I wonder if that could have performance issues
ok I was reading up on it and the express-jwt and it's client side library equivilant... (too lazy to type name) - what if I want to use a diffrent "secret" for each authenticating app?
can an identifier varable like appid: blah-blah-blah be sent with a secure payload but uneffecting the payload
Which would be a hybrid - use google, facebook, or your email/passphrase (they are all linked to your account anyway)
I have to issue "tokens" based off a secure secret - yes? What if I want to use a diffrent secure secret per app. Kind a like: This came from desktop, this came from the admin console, this came from xyz third party snazzy widget.
Similiar to how Facebook security works.
here's the worst question to ask: Can I do that with JWT?
I suppose the easiest thing to do is require a hash to be generated of the payload using the app.id and the app.sharedsecret and test the hash myself. but that doesn't really authticate a javascript app - unless it's requests through a server side "wrapper" which would proably help protect an app through CORS
domain javascript - sends commands to self server script which forwards request to server. no handshaking of tokens or secrets on client.
Eventually, I want to use this account api with all my app api's to help unify the experience - prevent multiple user registration.. etc. Give users access to one place to change user level data, payment info, etc... even though they may use google or facebook or some other provider to "Say hi" to the server - I still want a unified experience for the customer.
I'm still developing. But I got one app that has a API and a Web App (web app uses ajax to api). But I want to move user's, payments, etc... to it's own API. So any app I create can use the same functions.
Big reasons - I want to move notifications processing from my server - to it's own a app/server. So it can do all the socket processing, apple and android stuff...
I'm doing a lot of thinking - because I've been in dev shops where their was all action and no thinking. Products died and customers were lost because of dev's coding themselfs into a corner not preparing for high use and new features.
I'm trying to plot a design approach that says: "I'm preparing for the future" and one that can battle with the big boys.
I want to launch a real cool product idea but I would hate for the more wealthier competitor to find ways of making my life miserable and squishing me like a bug: ie hacks, poor performance, inability to make quick adjustments.
Well, there is no perfect solutions, technology and methods are always changing. Change what you can to meet the demands as they come. Early optimization can also lead to problems. You build for demand and fix the bottlenecks
Your design approach seems very different than those who've scolded me here in the past.
lol.
I suppose the easiest way to offload user processing is to just make it it's own set of objects (which I'll do anyway) and offload them when it is needed. At least this app has a very small set of simple objectives... you should see some of my more adventurous ideas.
So is JWT actually secure? If it's used client side?
does <svg> really only use absolute units only? in other words, I have to specify an absolute height/width like 500px? I'd have thought the positioning would be some relative coordinate system like -1,1 or 0-1/ . that way if my <div> is 500px wide than 0.5 would correspond to 250px..
or a free flowing NOSQL database - and I like SQL... specifically because my host has huge replicated servers with unlimited storage... I emphize that last part.
I should rephrase - I won't be billed for that kind of storage. :D
OHHHHHH! So the token is just an authentication key created by the server and used to authenticate to a requested api function.
JWT doesn't require a token be generated for each payload - it just needs to be provided to a payload. So in theory a payload doesn't need to have anything to do with a user, it could just authenticate a session. If a user logs in or not just depends on how the session goes.
so a path could be Webserver requests token from API server, token is stored in hidden field for client ajax calls to API Server. The API server can than determine to change the token (by sending back a request to change) or invalidate a token because it has expired. The issuer is not the client, it's the API server.
If anybody can follow that, kudos.
Does this idea make sense? Is this a good idea? In theory, steps to authenticate include "generate machine id" (client id), "get session token", and use token for all requests. Everytime the API is called it can check the session token against the machine id and other unique identifiers - whatever it wants - to help verify the session is authenticate (or as close as a webserver is going to get).
coupling this with SSL will help ensure data can't be intercepted. However if a hacker gets access to the client machine, and can run API calls through the validated browser than I suppose he or she could get access. I suppose that is where rate limiting, CORS, and ClickJacking preventive measures are needed.
If a token expires, the session data associated with that session becomes inaccessible (or purged depending on how lazy I am) the client just askes for a new token. I could also track sessions being created per "machine id" and prevent multiple active sessions. Using a UID, I could make that a app specific pin. If an app askes for a new session token, I'll expire the old one automagically.
Unless nefarious hacker is using a self built app that cares less about browser security.
I'll probably need to keep an eye out for problem sessions - luckily I'm offloading all my payments/charges (and there liability) to xyz secure processor (we all know which one). So I at least don't have financial data to secure but I do have my product and to me it's worth more than financial data.
I'd prefer to keep session data away from the client and make it the server's responsability to maintain and protect that data. I just want the happy client to do it's business not caring about some arbitrary id.
name being the common name of the function, type being the http verb (maybe verb is better), local just being short for location, and must is just the api's way of saying - it's not optional.
// //understand button $(".understandbtn").click(function(){ //reset the timer every 3 second of interval $('.actionBtnFloat').css('z-index','0');
//e_money var deduct = 100; var newMoney = {{user.e_money}} - deduct;
// send a message to the server that the e-money value has changed socket.emit('update e-money', username: getUserName(), //get the current user newMoney: newMoney );
//end
clearTimeout(interval);
but it keeps me an error on the console of chrome that says Uncaught SyntaxError: missing ) after argument list
on
socket.emit('update e-money', username: getUserName(), //get the current user newMoney: newMoney );
codesandbox.io/s/mwpR1Wvx9 in this react form i have added email and mobile number validation.website url. when i type backspace i get in console invalid error message. i do not want to error message after pressing back space in empty textbox
@abilasher Welcome to the JavaScript chat! Please review the room rules. Pleasedon't ask if you can ask or if anyone's around; just ask your question, and if anyone's free and interested they'll help.
I write some code for to convert svg to inline svg and take screenshot of that div . Please check .Please copy this code int to your local host and test it . Because screen shot is different in different width .
https://jsfiddle.net/7bqukhff/15/
<link href="style.css" rel="stylesheet">
<scrip...
i have a website . In which user can select any svg from the given svg list . When user select one svg then that svg is converted to inline svg displayed in one div . Also user can move that svg to any portion of the div . After everything then user will fill a froum and submit . At the time of submit we ant to download the screen shot of that div then we understand user select which colour , where the svg image is place etc
> Hummus, is a Levantine dip or spread made from cooked, mashed chickpeas or other beans, blended with tahini, olive oil, lemon juice, salt and garlic. Today, it is popular throughout the Middle East and in Middle Eastern cuisine around the globe.
@Learning regex creates a DFA. It doesn't really match by "exact" words. It follows the expression described. What you can do is to split the string using substring, lastIndexOf and then regex ofc
All mobile browsers have two viewports. The layout viewport constrains your CSS — width: 100% means 100% of the layout viewport — while the visual viewport describes the area of the page the user is currently seeing. This visualisation of the two viewports might be useful as a reminder. Today’s article studies what happens when these viewports change size. It also studies th…
I am trying to get a clear and concise understanding of HATEOAS, and I am by no means an expert WRT REST (I think I get it though, thanks to this http://tomayko.com/writings/rest-to-my-wife)
Can anyone suggest an equally enlighenting blog/article WRT HATEOAS?
debug1: Connection established. debug1: key_load_public: No such file or directory debug1: identity file prod-env.pem type -1 debug1: key_load_public: No such file or directory debug1: identity file prod-env.pem-cert type -1 debug1: Enabling compatibility mode for protocol 2.0 debug1: Local version string SSH-2.0-OpenSSH_7.5 ssh_exchange_identification: Connection closed by remote host
@OliverSalzburg random error while trying to ssh into my EC2