var oldRoot = document.documentElement;
var newRoot = oldRoot.cloneNode(true);
oldRoot.parentNode.replaceChild(newRoot, oldRoot);
var oldEventListenerKeeper = document.documentElement;
var observer = new MutationObserver(function(mutations)
{
mutations.forEach(function(mutation)
{
mutation.removedNodes.forEach(function(removedElement)
{
if (removedElement == oldEventListenerKeeper)
{
var newEventListenerKeeper = document.documentElement;
newEventListenerKeeper.addEventListener("keydown", (e)=>console.log(e), false);
oldEventListenerKeeper = newEventListenerKeeper;
}
});
});
});
разбить число на разряды с помощью jquery
final_price = (from1_price + from2_price + from3_price + from4_price + picking_price + insurance_price + exp_cat_price);
final_price = final_price.toLocaleString('ru');
$('.calculator #calc_price').text(final_price);
( LoadingBarWidth / ItMax ) * ItCurr
/* get frame block */
var commentBlock = document.getElementById("recentcomments");
/* link contains in tag 'p', find it all */
var pTags = commentBlock.getElementsByTagName("p");
/* if tag have class 'dsq-widget-meta' - delete it */
for (i=0; i<pTags.length; i++)
if(pTags[i].className === "dsq-widget-meta")
pTags[i].parentNode.removeChild(pTags[i]);
var commentsPageURL = "http://penzaurist.ru/%D0%BE%D1%82%D0%B7%D1%8B%D0%B2%D1%8B/";
/* get each comment */
var comments = commentBlock.getElementsByTagName("li");
/* get first and second link in comments and change it */
for (i=0; i<comments.length; i++){
/* get links */
var avatarLink = comments[i].getElementsByTagName("a")[0];
var nameLink = comments[i].getElementsByTagName("a")[1];
/* change */
avatarLink.setAttribute("href", commentsPageURL);
nameLink.setAttribute("href", commentsPageURL);
}