mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 05:25:32 +03:00
Base: Use string interpolation for all log outputs in formdata.html
This commit is contained in:
parent
e5a396ce28
commit
beba05471c
Notes:
sideshowbarker
2024-07-17 05:13:53 +09:00
Author: https://github.com/kennethmyhra Commit: https://github.com/SerenityOS/serenity/commit/beba05471c Pull-request: https://github.com/SerenityOS/serenity/pull/17729 Reviewed-by: https://github.com/linusg ✅
@ -4,14 +4,14 @@
|
||||
<title>FormData</title>
|
||||
<script>
|
||||
function log(s) {
|
||||
document.getElementById("out").innerHTML += s + "\n"
|
||||
document.getElementById("out").innerHTML += `${s}\n`;
|
||||
}
|
||||
|
||||
function dumpFormContents() {
|
||||
let form = document.getElementById("form1");
|
||||
form.onformdata = (e) => {
|
||||
log("Event 'formdata' fired.");
|
||||
log("First name logged from the formdata event: " + e.formData.get("first_name") + "\n");
|
||||
log(`First name logged from the formdata event: ${e.formData.get("first_name")}\n`);
|
||||
}
|
||||
|
||||
let formData = new FormData(form);
|
||||
@ -19,12 +19,12 @@
|
||||
let lastName = formData.get("last_name");
|
||||
let file = formData.get("avatar");
|
||||
let transportTypes = formData.getAll("transport_type");
|
||||
log("First name: " + firstName);
|
||||
log("Last name: " + lastName);
|
||||
log("file: " + file.type);
|
||||
log(`First name: ${firstName}`);
|
||||
log(`Last name: ${lastName}`);
|
||||
log(`file: ${file.type}`);
|
||||
log("Transportation types:");
|
||||
for (let i = 0; transportTypes.length > i; i++)
|
||||
log(" - " + transportTypes[i]);
|
||||
log(` - ${transportTypes[i]}`);
|
||||
|
||||
log("\n Iterate over keys: ")
|
||||
for (let key of formData.keys()) {
|
||||
|
Loading…
Reference in New Issue
Block a user