In a jQuery callback, I would like to store a status of the dom and to restore this status when escape key is pressed :
$(document).ready(function() {
// add callbacks
// TODO : *** store dom ***
$( ".editable" ).click(function () {
// add other callbacks
$("#add").keyup(function(e){
if (e.keyCode == 27) { // escape
// TODO : *** restore dom ***
}
});
});
});
Is there a way to do it ?
We solved the problem by reloading the page with window.location.href=”url” :
So we don’t need to store any status. Just rely on http request.