Fix: typos
This commit is contained in:
parent
79417c6e73
commit
0152adcc0d
1 changed files with 2 additions and 2 deletions
|
@ -54,14 +54,14 @@ In this example, the server code is not presented, as it's beyound our scope. Th
|
|||
We can modify fields in `FormData` with methods:
|
||||
|
||||
- `formData.append(name, value)` - add a form field with the given `name` and `value`,
|
||||
- `formData.append(name, blob, fileName)` - add a field as if it were `<input type="file">`, the third argument `fileName` sets file name (not form field name), as it it were a name of the file in user's filesystem,
|
||||
- `formData.append(name, blob, fileName)` - add a field as if it were `<input type="file">`, the third argument `fileName` sets file name (not form field name), as it were a name of the file in user's filesystem,
|
||||
- `formData.delete(name)` - remove the field with the given `name`,
|
||||
- `formData.get(name)` - get the value of the field with the given `name`,
|
||||
- `formData.has(name)` - if there exists a field with the given `name`, returns `true`, otherwise `false`
|
||||
|
||||
A form is technically allowed to have many fields with the same `name`, so multiple calls to `append` add more same-named fields.
|
||||
|
||||
There's also method `set`, with the same syntax as `append`. The difference is that `.set` removes all fields with the given `name`, and then appends a new field. So it makes sure there's only field with such `name`, the rest is just like `append`:
|
||||
There's also method `set`, with the same syntax as `append`. The difference is that `.set` removes all fields with the given `name`, and then appends a new field. So it makes sure there's only one field with such `name`, the rest is just like `append`:
|
||||
|
||||
- `formData.set(name, value)`,
|
||||
- `formData.set(name, blob, fileName)`.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue