You’re reading the English version of this content since no translation exists yet for this locale. Help us translate this article!
FormData
인터페이스의 has()
메서드는 FormData
객체에 특정 키가 들어 있는지 여부를 나타내는 boolean 을 반환합니다.
Note: 이 메서드는 웹워커(Web Workers)에서도 사용할 수 있습니다.
Syntax
formData.has(name);
Parameters
name
- 테스트 하려는 키의 이름을 나타내는
USVString
입니다.
Returns
Example
다음 코드를 따라 빈 FormData
객체를 만듭니다:
var formData = new FormData();
다음 스니펫(코드 조각)은 FormData
객체안에 username
이 존재하는지 테스트한 결과와, FormData.append
를 사용하여 username
에 값을 추가한 이후의 결과를 보여줍니다 :
formData.has('username'); // Returns false formData.append('username', 'Chris'); formData.has('username'); // Returns true
Specifications
Specification | Status | Comment |
---|---|---|
XMLHttpRequest The definition of 'has()' in that specification. |
Living Standard |
Browser compatibility
The compatibility table on this page is generated from structured data. If you'd like to contribute to the data, please check out https://github.com/mdn/browser-compat-data and send us a pull request.
Update compatibility data on GitHub
Desktop | Mobile | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
has | Chrome Full support 50 | Edge Full support 18 | Firefox Full support 39 | IE No support No | Opera Full support Yes | Safari Full support 11 | WebView Android Full support Yes | Chrome Android Full support 50 | Firefox Android Full support Yes | Opera Android Full support Yes | Safari iOS No support No | Samsung Internet Android Full support Yes |
Legend
- Full support
- Full support
- No support
- No support