« first day (3207 days earlier)      last day (1963 days later) » 

04:24
I would like to try out workers in javascript, and have each worker print to the screen so each worker has a for loop and I want to see the outputs mingle. The problem is that workers don't have access to 'document'. So is it not possible?
 
4 hours later…
08:49
What's the alternative of scriptlets in nodejs? I come from java background and there we use JSTL tags for modularity as using scriptlets are considered bad practice
@jatin 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.
 
4 hours later…
12:59
Hi to room.
Form exists. console.log shows it. However, serialized() is working but FormData doesn't. I need FormData since I want to send image through form. What am I missing?

So: $(form)[0] is HTML element how it should be but new FormData($(form)[0]) is empty object. Any help would be appreciated.
 
3 hours later…
16:15
@jatin When building a web app with JS, you would usually use tooling like Webpack or Rollup to bundle JS into one, minified file, then have that linked to the HTML page
@jatin "scriptlets"? What year is it?
Can you describe the desired functionality, and we'll try to give you an overview of the architecture?
Evening.
@MadaraUchiha
What could be possible reason FormData object (after passing HTML form to it) is empty.
Where to start googling?
user8729657
16:52
Hey is it possible to pass data to different routes in express?
@Tpojka Code?
Tried everything and still getting empty object. Tried to pass form html element to FormData class instantiation. Also tried to instantiate formData object, then append it with name, elements and still getting empty object. Sec.
That's not code
https://pastebin.com/3LR5Rw6X
I am not much JS but seemed I was better than frontend I have on this (it is all my code there).

What ever I console.log() out it exists there (form, form input elements) but no way FormData being hydrated with it. :/
This works. Compare that with your code
17:07
It's table of rows of data. On edit button bootstrap modal is popped up. There is save button and on save button I want to send AJAX with changed data. I need to use FormData since profile_image is also possible to change.
If I wouldn't need to change image serialize() method used on form is working well - filled with fields' values. But struggling with FormData object. Tried from Mozilla API and SO answers (which are mostly the same) but didn't have success with it.

I will try your example now.
It is strange to me (problem is in section 96-116) that everything is there, form is working as expected, fields' values are there. But new FormData is wrong somehow.
Give me few minutes.
It is still before AJAX. You can use passed name complementary of form id?
17:37
I am going again with that edit method from scratch. Basically:

// on edit-button click: open modal
// when modal is open: populate fields with edittingStaff object
// if save-button is clicked: populate FormData with form fields' values

All these I had on mind first time too...
17:56
@MadaraUchiha Suppose the starting file (say app.js) has an array/list which is being sent to an html page (say index.html) to display all the contents of the passed array using an unordered list tag. Using scriptlet we can write a for loop. so what could be the alternative to this?
@jatin You make a web server with Node.js, probably with something like ExpressJS, and respond to the request with whatever you need.
correct. suppose I am sending an html file in response to the request containing the unordered list
using ejs for templating
I mean using ejs file instead of Html
inside ejs file i would have to iterate over the list passed by the server file
How could that be done with out scriptlet
@jatin ejs supports loops
That's a job for your templating engine.
18:13
@MadaraUchiha but writing scripts inside view module is not a good practice right?
Can we avoid it?
I totally simplified file and left this code only. Result is in this image, totally mind-blowing.
18:39
hey everyone
I'm trying to call the Twitch API in my web app ... I got it all configured so that the app can print the correct URL w/ query - and requesting that in the browser actually returns the JSON data.
but when I do it in the app itself - I keep getting blocked by CORS.
I've already set Access-Control-Allow-Origin to allow either * or api.twitch.tv but none of them seem to work
I basically want to do a search for streams
It's not you that's supposed to enable CORS
It's Twitch.
@MadaraUchiha I did register in their site OAuth Redirect URL localhost:3000
Does docs say it API allows localhost testing?
it even has a note saying
Will receive the result of all client authorizations: either an access token or a failure message. This must exactly match the redirect_uri parameter passed to the authorization endpoint. When testing locally, you can set this to http://localhost.
19:02
Ok, just asking.
^^Well, regarding FormData, who made it get method returns value and whole object output shows empty object...
Seems I have something in object and can move on. Darn.
[Doh](https://i.imgur.com/rVblO3W.png).
 
2 hours later…
21:29
hello
21:41
Hi!

« first day (3207 days earlier)      last day (1963 days later) »