$key = isset($_GET['key']) ? (int)$_GET['key'] : null;
$iin = isset($_GET['iin']) ? (int)$_GET['iin'] : null;
if(!empty($key) && !empty($iin)) {
TrekInfo($key, $iin); // Отправляем данные в API
} else {
echo 'Упс! Что-то не так с параметрами запроса!';
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
</head>
<body>
<div id="product_select_value" style="font-weight:bold">2</div>
<input type="text" id="input">
<script src="index.js"></script>
</body>
</html>
// Input for changing target DIV
const input = document.getElementById('input')
input.addEventListener('change', function(e) {
targetNode.innerHTML = e.target.value
})
// Select the node that will be observed for mutations
const targetNode = document.getElementById('product_select_value')
// Callback function to execute when mutations are observed
function callback(mutationsList) {
for(var mutation of mutationsList) {
if (mutation.type == 'childList') {
if(mutation.target.textContent === '1') {
console.log('Hide some data')
} else {
console.log('Show some data')
}
}
}
};
// Create an observer instance linked to the callback function
const observer = new MutationObserver(callback)
// Start observing the target node for configured mutations
observer.observe(targetNode, { childList: true })
// Later, you can stop observing
// observer.disconnect()
git diff --name-only SHA1 SHA2
# or
git diff --name-only HEAD~10 HEAD~5
#myModal.modal-dialog {
width: 500px!important;
}
from django.db.models.signals import post_save
from django.dispatch import receiver
class Profile(models.Model):
user = models.OneToOneField(User, on_delete=models.CASCADE)
...
@receiver(post_save, sender=User)
def create_user_profile(sender, instance, created, **kwargs):
if created:
Profile.objects.create(user=instance)
@receiver(post_save, sender=User)
def save_user_profile(sender, instance, **kwargs):
instance.profile.save()
def __str__(self):
return self.user