Toggle navigation
Toggle navigation
This project
Loading...
Sign in
2020-1-capstone-design1
/
Triz_Project1
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
minsung
2020-04-24 14:09:41 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1cefc4980411a29e905ae6b26d3e3736fda3e6c4
1cefc498
1 parent
9f3ad802
pratice fetch api and make ajax form using ajax
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
60 additions
and
11 deletions
front/web/JS/validation.js
front/web/ex/fetch.html
front/web/ex/fetch2.html
front/web/signinmain.html
front/web/JS/validation.js
View file @
1cefc49
...
...
@@ -37,3 +37,14 @@ function checkValidation(self){
}
else
return
false
;
}
function
ajaxvalidation
(
self
){
$
(
document
).
ready
(
function
(){
var
email
=
document
.
querySelector
(
'#evalidation'
);
var
fpassword
=
document
.
querySelector
(
'#evalidation'
);
})
}
...
...
front/web/ex/fetch.html
View file @
1cefc49
<!DOCTYPE html>
<html>
<script
src=
"../fetch-master/fetch.js"
></script>
<body>
<input
type=
"button"
value=
"fetch"
onclick=
"
/*
fetch('css').then(function(response){
response.text().then(function(text){
alert(text);
})
})
*/
function callbackme(){
console.log('response end');
}
fetch('html').then(callbackme); //
console.log(1);
console.log(2);
});
"
>
</body>
</html>
...
...
front/web/ex/fetch2.html
0 → 100644
View file @
1cefc49
<!doctype html>
<html>
<head>
<title>
WEB1 - Welcome
</title>
<meta
charset=
"utf-8"
>
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"
></script>
<script
src=
"colors.js"
></script>
<script
src=
"../fetch-master/fetch.js"
></script>
</head>
<body>
<h1><a
href=
"#!welcome"
>
WEB
</a></h1>
<h1><a
href=
"index.html"
>
WEB
</a></h1>
<h2><a
href=
"welcome.html"
>
Welcome
</h2>
<input
id=
"night_day"
type=
"button"
value=
"night"
onclick=
"
nightDayHandler(this);
"
>
<ol
id=
"nav"
>
</ol>
<article>
</article>
<script>
function
fetchPage
(
name
){
fetch
(
name
).
then
(
function
(
response
){
response
.
text
().
then
(
function
(
text
){
document
.
querySelector
(
'article'
).
innerHTML
=
text
;
})
});
}
if
(
location
.
hash
){
fetchPage
(
location
.
hash
.
substr
(
2
));
}
else
{
fetchPage
(
'welcome'
);
}
fetch
(
'list'
).
then
(
function
(
response
){
response
.
text
().
then
(
function
(
text
){
document
.
querySelector
(
'#nav'
).
innerHTML
=
text
;
})
});
</script>
</body>
</html>
front/web/signinmain.html
View file @
1cefc49
...
...
@@ -5,7 +5,8 @@
<meta
charset=
"utf-8"
>
<link
rel=
"stylesheet"
href=
"style/style.css"
>
<script
src=
"JS/validation.js"
></script>
<script
src=
"https://ajax.googleapis.com/ajax/libs/jquery/3.4.1/jquery.min.js"
>
</script>
</head>
<body>
...
...
Please
register
or
login
to post a comment