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?
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.
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.
@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
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.
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?
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
@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?
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
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.
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).