Toggle navigation
Toggle navigation
This project
Loading...
Sign in
구희연
/
Food_recipe_info
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Graphs
Network
Create a new issue
Commits
Issue Boards
Authored by
윤희찬
2021-11-26 22:42:14 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
310f9a79d8ba7e90fde68d685ddf351a19b64e48
310f9a79
1 parent
b599e6ed
Update main.js
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
3 deletions
main/main.js
main/main.js
View file @
310f9a7
...
...
@@ -9,12 +9,15 @@ searchForm.addEventListener('submit', function(event){
alert
(
'한글자 이상 입력해주세요'
);
event
.
preventDefault
();
}
searchQuery
=
event
.
target
.
querySelector
(
'input'
).
value
;
fetchAPI
();
else
{
event
.
preventDefault
();
searchQuery
=
event
.
target
.
querySelector
(
'input'
).
value
;
fetchAPI
();
}
});
async
function
fetchAPI
(){
const
recipeURL
=
`https://api.edamam.com/search?q=
pizza
&app_id=
${
APP_ID
}
&app_key=
${
APP_KEY
}
`
;
const
recipeURL
=
`https://api.edamam.com/search?q=
${
searchQuery
}
&app_id=
${
APP_ID
}
&app_key=
${
APP_KEY
}
`
;
const
response
=
await
fetch
(
recipeURL
);
const
data
=
await
response
.
json
();
boxinfo
(
data
.
hits
);
...
...
Please
register
or
login
to post a comment