<iframe src="https://www.google.com/maps/embed?pb=!1m18!1m12!1m3!1d46773.46179010857!2d75.0502236986581!3d42.88674406324874!2m3!1f0!2f0!3f0!3m2!1i1024!2i768!4f13.1!3m3!1m2!1s0x389c041f79348bad%3A0x23897ba069e66c57!2z0JjQstCw0L3QvtCy0LrQsCwg0JrQuNGA0LPQuNC30LjRjw!5e0!3m2!1sru!2sru!4v1491857183017" width="600" height="450" frameborder="0" style="border:0" allowfullscreen></iframe>
<script src="//api-maps.yandex.ru/2.0/?load=package.standard&lang=ru-RU" type="text/javascript"></script>
$(document).ready(function($) {
ymaps.ready(init);
function init() {
var geolocation = ymaps.geolocation;
if (geolocation) {
$text_city = geolocation.country + ', ' + geolocation.region + ', ' + geolocation.city;
//console.log($text_city);
$("#city0").val($text_city);
$("#city1").val($text_city);
$("#city2").val($text_city);
$("#city3").val($text_city);
$("#city4").val($text_city);
$("#city_call").val($text_city);
$("#city_modreserve").val($text_city);
$("#city_reserve").val($text_city);
} else {
console.log('Не удалось установить местоположение');
}
}
});
<button id="show">Показать на карте</button>
<div id="map" style="width: 300px; height: 300px"></div>
ymaps.ready(init);
var myMap;
function init(){
myMap = new ymaps.Map ("map", {
center: [55.76, 37.64],
zoom: 7
})}
var el = document.getElementById("show");
el.addEventListener("click", showBal, false);
function showBal(){
myMap.balloon.open(myMap.getCenter(), { content: 'Hello Yandex!' }, { closeButton: true });
}
<div id="boxes">
<input type="checkbox" data-exval="2000">Доставка
<input type="checkbox" data-exval="500">Подъем
<input type="checkbox" data-exval="2500">Монтаж
</div>
<div>Итого: <span id="result"></span></div>
$(document).ready(function(){
$("#boxes input[type='checkbox']").click(function(){
var total=0;
$("#boxes input[type='checkbox']:checked").each(function(){
total += parseInt($(this).data("exval"),10);
});
$("#result").text(total);
});
});
var someArray = [{name:'test', lastname: 'test', gender:'f'},{name:'test1', lastname: 'test1', gender:'f'},{name:'test2', lastname: 'test2', gender:'m'}];
$.each(someArray, function(i){
if(someArray[i].gender === 'm') {
someArray.splice(i,1);
return false;
}
});
console.log(someArray);
someArray = [{name:'test', lastname: 'test', gender:'f'},{name:'test1', lastname: 'test1', gender:'f'},{name:'test2', lastname: 'test2', gender:'m'}];
johnRemoved = someArray
.filter(function (el) {
return el.gender !== "m";
}
);
console.log(johnRemoved);