Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

43장 Ajax #45

Open
humonnom opened this issue May 29, 2022 · 0 comments
Open

43장 Ajax #45

humonnom opened this issue May 29, 2022 · 0 comments
Assignees

Comments

@humonnom
Copy link
Collaborator

const xhr = new XMLHttpRequest();
xhr.open('GET', 'https://jsonplaceholder.typicode.com/todos/1');
xhr.send();
xhr.onload = () => {
    // HTTP 요청이 성공적으로 완료된 경우에만 발생
    if (xhr.status === 200){
        console.log(JSON.parse(xhr.response));
    } else {
        console.log('Error', xhr.status, xhr.statusText);
    }
}
@humonnom humonnom self-assigned this May 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant