1) myShinyData would be a JavaScript object, which is why it can be dereferenced using object noation (.
or ["key"]
).
2) After instantiation, the object would contain a key:value pair for each input field within the form, where the key would be the name of the field and the value would be the value.
3) The [0]
on $("#myAjaxUploadForm")
references the actual form on the page itself. When you use jQuery to select an object, you get back a jQuery object. A jQuery object is a wrapper around a normal DOM object to expose additional methods that can be executed against it.
$("#myAjaxUploadForm")[0] === document.getElementById("myAjaxUploadForm")
4) Yes, if you append a new key to the FormData, you can access it using dot notation or array notation:
myShinyData.username
myShinyData["username"]
5) The information available by default would be what is in the form; I assume this would include the file name, but that may require some parsing. Any other information would need to be obtained programmatically, either using the information you already have, or some other means.