mirror of
https://github.com/Blair-SGA-Dev-Team/blazerapp.git
synced 2024-12-22 06:22:44 -05:00
callback pls
This commit is contained in:
parent
f9b9cae6eb
commit
4da5834934
|
@ -84,6 +84,8 @@ fn rocket(port: u16, address: String, env: Environment, pg: PgConnection, sa: Se
|
|||
data::ssl_ops::api,
|
||||
data::calendar::api,
|
||||
data::polls::api,
|
||||
data::new::api,
|
||||
data::important::api
|
||||
])
|
||||
.mount(
|
||||
"/ui",
|
||||
|
|
|
@ -13,15 +13,17 @@ function forwardForImage(id, postloc) {
|
|||
}
|
||||
if (form_elem[i].type == "file") {
|
||||
var file = document.getElementById(form_elem[i].id).files[0];
|
||||
getBase64(file, form_elem, i, data, (form_elem, i, data, res) => {
|
||||
data.push(form_elem[i].name + "=" + res);
|
||||
getBase64(file, form_elem, i, data, function(form_elem, i, data, res) {
|
||||
data.push(form_elem[i].name + "=" + encodeURIComponent(res));
|
||||
});
|
||||
}
|
||||
}
|
||||
console.log(data);
|
||||
console.log(data[3]);
|
||||
var params = data.join("&");
|
||||
var xhr = new XMLHttpRequest();
|
||||
xhr.open("POST", postloc, true);
|
||||
console.log(params);
|
||||
xhr.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
|
||||
xhr.send(params);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user