fetch('https://jsonplaceholder.typicode.com/users')
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
fetch('https://jsonplaceholder.typicode.com/users')
.then(res => res.json())
.then(json => console.log(json))
.catch(err => console.error('Error:', err));
<!doctype html>
<html lang="en">
<head>
<title>media query</title>
<!-- Required meta tags -->
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
<style>
@media only screen and (max-width:600px) {
.tp{
background-color: red;
}
}
@media only screen and (min-width:600px) {
.tp{
background-color: green;
}
}
@media only screen and (min-width:768) {
.tp{
background-color: blue;
}
}
@media only screen and (max-width:992) {
.tp{
background-color: pink;
}
}
@media only screen and (min-width:1200) {
.tp{
background-color: yellow;
}
}
</style>
</head>
<body>
<div class="tp h-50 w-50">
test media query
</div>
<!-- Optional JavaScript -->
<!-- jQuery first, then Popper.js, then Bootstrap JS -->
<script src="https://code.jquery.com/jquery-3.3.1.slim.min.js" integrity="sha384-q8i/X+965DzO0rT7abK41JStQIAqVgRVzpbzo5smXKp4YfRvH+8abtTE1Pi6jizo" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.7/umd/popper.min.js" integrity="sha384-UO2eT0CpHqdSJQ6hJty5KVphtPhzWj9WO1clHTMGa3JDZwrnQq4sF86dIHNDz0W1" crossorigin="anonymous"></script>
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/js/bootstrap.min.js" integrity="sha384-JjSmVgyd0p3pXB1rRibZUAYoIIy6OrQ6VrjIEaFf/nJGzIxFDsf4x0xIM+B07jRM" crossorigin="anonymous"></script>
</body>
</html>
$.ajax({
url : ".php file path.php",
method : "POST",
data : JSON.stringify(param),
success : function(res){
res = JSON.parse(res);
if(res.result == 200)
{
//
}
}
}).fail(function(){
//
});
//Kirtishil Patil
var xhttp = new XMLHttpRequest();
xhttp.open("POST", "filename with complete path.php", true);
xhttp.onreadystatechange = function() {
if (this.readyState == 4 && this.status == 200) {
var res = this.responseText;
var res_arry = JSON.parse(res);
if (res_arry["result"] == 200) {
//write here
} else {
//write here
}
}
};
var param = {//write param here};
xhttp.send(JSON.stringify(param));
<script>
$("#my_modal").on('show.bs.modal',function(){
//before modal open
})
$("#my_modal").on('shown.bs.modal',function(){
//after modal open
})
$("#my_modal").on('hide.bs.modal',function(){
//before modal close
})
$("#my_modal").on('hidden.bs.modal',function(){
//after modal close
})
</script>
//Kirtishil Patil
.loader,.loader {
font-size: 15px;
text-indent: -9999em;
width: 1.5em;
height: 1.5em;
border-radius: 50%;
background: #585858;
background: -moz-linear-gradient(left, #585858 10%, rgba(255, 255, 255, 0) 42%);
background: -webkit-linear-gradient(left, #585858 10%, rgba(255, 255, 255, 0) 42%);
background: -o-linear-gradient(left, #585858 10%, rgba(255, 255, 255, 0) 42%);
background: -ms-linear-gradient(left, #585858 10%, rgba(255, 255, 255, 0) 42%);
background: linear-gradient(to right, #585858 10%, rgba(255, 255, 255, 0) 42%);
position: relative;
-webkit-animation: load3 1.4s infinite linear;
animation: load3 1.4s infinite linear;
-webkit-transform: translateZ(0);
-ms-transform: translateZ(0);
transform: translateZ(0);
}
.loader:before {
width: 50%;
height: 50%;
background: #585858;
border-radius: 100% 0 0 0;
position: absolute;
top: 0;
left: 0;
content: '';
}
.loader:after {
background: #fff;
width: 75%;
height: 75%;
border-radius: 50%;
content: '';
margin: auto;
position: absolute;
top: 0;
left: 0;
bottom: 0;
right: 0;
}
@-webkit-keyframes load3 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
@keyframes load3 {
0% {
-webkit-transform: rotate(0deg);
transform: rotate(0deg);
}
100% {
-webkit-transform: rotate(360deg);
transform: rotate(360deg);
}
}
//Kirtishil Patil
this code is used to display active element with blue background from lists
$('#ul_id').on('click', 'li', function()
{
$(this).addClass('active').siblings().removeClass('active');
});