let dataList = {};
fetch('https://api.hh.ru/areas/113').then(response => {
return response.json();
}).then(
json => {
const cities = json.areas.reduce((array, area) => {
const citiesAtArea = area.areas.reduce((citiesArray, city) => {
return [...citiesArray, city.name]
}, [])
return [...array, ...citiesAtArea]
}, [])
console.log(cities)
}
);
request
.then(async (res) => ({
body: await res.blob(),
contentDisposition: res.headers.get('Content-Disposition')
}));
div.title, внутри которого потом появится кнопка.
elem, изменится и его «оригинал» – элемент массива. Но нет. Число возвели в квадрат, но в массиве всё осталось по-прежнему.elem не числом, а объектом, трюк сработал бы. let arr = [ {x: 1}, {x: 2}, {x: 3}, {x: 4}, {x: 5} ];
for (let elem of arr) {
elem.x = elem.x ** 2;
}
// [ {"x": 1}, {"x": 4}, {"x": 9}, {"x": 16}, {"x": 25} ]navigator.clipboard.writeText("123")
//Текст корзины
add_filter('gettext', 'change_checkout_btn');
add_filter('ngettext', 'change_checkout_btn');
//function
function change_checkout_btn($checkout_btn){
$checkout_btn= str_ireplace('Shopping cart', 'Корзина', $checkout_btn);
$checkout_btn= str_ireplace('close', 'закрыть', $checkout_btn);
$checkout_btn= str_ireplace('Оформить заказ', 'Оформить заказ', $checkout_btn);
return $checkout_btn;
}
//Текст корзины
add_action( 'woocommerce_widget_shopping_cart_buttons', function(){
// Removing Buttons
remove_action( 'woocommerce_widget_shopping_cart_buttons', 'woocommerce_widget_shopping_cart_proceed_to_checkout', 20 );
// Adding customized Buttons
add_action( 'woocommerce_widget_shopping_cart_buttons', 'custom_widget_shopping_cart_button_view_cart', 10 );
}, 1 );
// Custom cart button
function custom_widget_shopping_cart_button_view_cart() {
$original_link = wc_get_cart_url();
$custom_link = home_url( 'http://metallika.by/#contact' ); // HERE replacing cart link
echo '<a href="' . esc_url( $custom_link ) . '" class="button wc-forward">' . esc_html__( 'View cart', 'woocommerce' ) . '</a>';
}
<body>
<p>Название</p>
<audio src='audio/Dich.mp3' controls audioplay></audio>
<p>Название</p>
<audio src='audio/Flower.mp3' controls audioplay></audio>
<p>Название</p>
<audio src='audio/Dich.mp3' controls audioplay></audio>
<p>Название</p>
<audio src='audio/Flower.mp3' controls audioplay></audio>
<p>Название</p>
<audio src='audio/Dich.mp3' controls audioplay></audio>
<p>Название</p>
<audio src='audio/Flower.mp3' controls audioplay></audio>
<script>
const aud = document.querySelectorAll('audio')
Array.from(aud).map(el => el.addEventListener('play', () => {
const played = document.querySelector('[data-play="true"]')
if(played && played !== el) {
played.pause()
played.removeAttribute('data-play')
}
el.dataset.play = 'true'
}))
</script>
</body>