JQuery: how to release all event handlers, dom changes?

Is there a way to reset the current page? free all event handlers, remove any CSS that jQuery switches, simply put, restoring the page to its original state without updating?

+3
source share
2 answers

refresh/reload page. There no other way. I commented on the OP post.

But thinking about it, I think there is a way.

In the css part, animations are performed by attribute style. Removing the stylereset attribute of an element from the animation. But stylekeep in mind that if you used the attribute to style your element, it will also be erased.

In a binding event, you can associate events with names. For example, a snap would look something like this,

$('#someID').bind('click.toBeRemove', function(){...})

, $('*').unbind('.toBeRemove'). ( click).

, .destroy(), .

100%. . NO . - ! $(window).reset(), reset .

0

, - body, , - , , reset, body .

var original = $('body').clone();

$('#reset').click(function() {
    $('body').replaceWith(original);
}); 

, , , , head, , , , ?

: http://jsfiddle.net/uevrM/

: , , live delegate. , , 100% .

+2

Source: https://habr.com/ru/post/1768165/


All Articles