String.prototype.modifyStr = function(UpDown = 'Up', invertFirstLetter = false) {
let workingLine = String(this)
if (UpDown) {
workingLine = String(this).replace( /[a-zA-Z]|[а-яА-Я]/g, match => {
if (match == match.match(/[a-z]|[а-я]/)) {
return String.fromCharCode(match.charCodeAt(0) - ((match == 'ё') ? 80 : 32) )
}
else return match
})
} else if (!UpDown){
workingLine = String(this).replace( /[a-zA-Z]|[а-яА-Я]/g, match => {
if (match == match.match(/[A-Z]|[А-Я]/)) {
return String.fromCharCode(match.charCodeAt(0) + ((match == 'ё') ? 80 : 32) )
}
else return match
})
}
if (invertFirstLetter) {
let firstLetter = workingLine[0],
newLetter
if ( firstLetter == firstLetter.match( /[a-z]|[а-я]/g ) ) {
newLetter = String.fromCharCode(firstLetter.charCodeAt(0) - ((firstLetter == 'ё') ? 80 : 32) )
} else if ( firstLetter == firstLetter.match( /[A-Z]|[А-Я]/g ) ) {
newLetter = String.fromCharCode(firstLetter.charCodeAt(0) + ((firstLetter == 'ё') ? 80 : 32) )
}
return workingLine.replace(firstLetter, newLetter)
} else return workingLine
}
function getContent(){
var http = new XMLHttpRequest();
http.open('GET', 'https://twitter.com/navalny'); // URL страницы сайта
http.onreadystatechange = function () {
if (this.readyState == 4 && this.status == 200) {
var doc = new DOMParser().parseFromString(this.responseText, "text/html"); // преобразовать текст в HTML
document.write(doc)
}
}
http.send(null);
}
<script>
$(function() {
$("#sender").children('input[name="forma-gender"]').change(function(e) {
var t = $(this).serialize();
$.ajax({
url: "/2018/tech/senderapi.php",
type: "post",
data: t,
success: function(e) {
$("#result_sender").html(e)
}
})
})
})
</script>
if(
(isset( $_POST['roomC'] ) && ($_POST['roomC'] != '')) ||
(isset( $_POST['room1'] ) && ($_POST['room1'] != '')) ||
(isset( $_POST['room2'] ) && ($_POST['room2'] != '')) ||
(isset( $_POST['room3'] ) && ($_POST['room3'] != '')) ||
(isset( $_POST['room4'] ) && ($_POST['room4'] != '')) ||
(isset( $_POST['room5'] ) && ($_POST['room5'] != ''))
){
$arrRooms = [];
if ( isset( $_POST['roomC'] ) && ($_POST['roomC'] != '') ) $arrRooms[] = 'C';
if ( isset( $_POST['room1'] ) && ($_POST['room1'] != '') ) $arrRooms[] = '1';
if ( isset( $_POST['room2'] ) && ($_POST['room2'] != '') ) $arrRooms[] = '2';
if ( isset( $_POST['room3'] ) && ($_POST['room3'] != '') ) $arrRooms[] = '3';
if ( isset( $_POST['room4'] ) && ($_POST['room4'] != '') ) $arrRooms[] = '4';
if ( isset( $_POST['room5'] ) && ($_POST['room5'] != '') ) $arrRooms[] = '5+';
$args['meta_query'][] = array(
'key' => 'room',
'value' => $arrRooms,
'type' => 'char',
'compare' => 'IN'
);
}
add_action('wp_enqueue_scripts', function(){
wp_add_inline_script('my_scripts', 'var templateDirectory = ' . get_template_directory_uri() );
});
<?php wp_head() ?>
<head>
btn {
border: 0px solid #000000;
width: 160px;
color: #ffffff; /* The color of text in button - WHY DOESN'T IT WORK?*/
text-decoration: none; /* The link style in button - WHY DOESN'T IT WORK?*/
background: #FBD840;
padding: 12px;
text-align: center;
margin-bottom: 30px;
border-radius: 3px;
box-shadow: 0px 3px 15px 3px rgba(249,219,91,0.4);
cursor: pointer;
.btn{...}
button{...}