minsung

pratice fetch api and make ajax form using ajax

......@@ -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');
})
}
......
<!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>
......
<!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>
......@@ -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>
......