I am trying to upload a file to a server, and have my DOM element setup as such:
_uploadForm = document.createElement("form");
_uploadForm.method = "POST";
_uploadForm.action = "#";
if(_isBrowser.IE)
_uploadForm.encoding = "multipart/form-data";
else
_uploadForm.enctype = "multipart/form-data";
My server requires an http basic authorization header. How can I pass that through this DOM element?
DOM elements have nothing to do with authorization, they’re just the internal browser’s representation of the various html tags. Authorization is demanded by the server – if the page is in a protected area, then the server will demand credentials, and that has nothing to do with the form itself.