var data = null;
fetch('some url')
.then(
response => {
data = response;
},
error => alert(`Rejected: ${error}`)
);
fetch('some url')
.then(
response => {
someFunc(response);
},
error => alert(`Rejected: ${error}`)
);
someFunc(data) {
alert(data);
}
function setHref(item, href) {
item.attr('href', href);
}
$tabsTariff.each( function() {
var href = '#b-popup-classic-' + $( this ).attr('data-tab-name');
if ( $( this ).hasClass('b-tabs__item-title_state_current') ) {
setHref($linkPopup, href);
}
$( this ).on( 'click', function() {
setHref($linkPopup, href); // дубль
} );
} );
$(function () {
$('.bill_botton').click(function () {
var login = $('#authLogin').val();
var password = $('#authPassword').val();
$.ajax({
type: "POST",
url: 'https://lk.webvm.ru/billmgr?authinfo="' + login + '":"' + password + '"&out=xml&func=user',
dataType: "xml",
success: function (data) {
var xmlDoc = $.parseXML(data),
xml = $(xmlDoc),
xmlEmail = xml.find("email");
alert(xmlEmail);
},
// если произошла ошибка при получении файла
error: function () {
alert('ERROR');
}
});
});
});
localStorage.setItem('chat', 'test');
var data = localStorage.getItem('chat');
localStorage.removeItem('chat');
sessionStorage.setItem('chat', 'test');
var data = sessionStorage.getItem('chat');
sessionStorage.removeItem('chat');