The browser sends a request to the website :URL and Form submission
Get
Post
characteristic : page refresh
besides , It can also be based on Ajax Send a request to the background ( A furtive request , The page will not refresh )
rely on jQuery
To write ajax Code
$.ajax({
url:" Address sent ",
type:"get",
dataType:'JSON',
data:{
n1:123,
n2,456
},
success:function(res){
console.log(res);
}
}) <script type="text/javascript">
function clickMe(){
$.ajax({
url:'/staffmanagement/task/ajax/',
type:"get",
dataType:'JSON',
data:{
n1:123,
n2:456
},
success:function (res){
console.log(res)
}
})
}
</script>def ajax(request): print(re